mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* search component add new style * update vue version and support ssr * unit test * add new icon * new icon
40 lines
923 B
JavaScript
40 lines
923 B
JavaScript
import Vue from 'vue';
|
|
import VueRouter from 'vue-router';
|
|
import App from './ExamplesApp';
|
|
import navConfig from './nav.config.js';
|
|
import routes from './router.config';
|
|
import ZanUI from 'src/index';
|
|
|
|
import 'packages/vant-css/src/index.css';
|
|
|
|
import DemoList from './components/demo-list.vue';
|
|
|
|
Vue.use(ZanUI);
|
|
Vue.use(ZanUI.Lazyload, {
|
|
lazyComponent: true
|
|
});
|
|
Vue.use(VueRouter);
|
|
|
|
const routesConfig = routes(navConfig, true);
|
|
routesConfig.push({
|
|
path: '/',
|
|
component: DemoList.default || DemoList
|
|
});
|
|
const router = new VueRouter({
|
|
mode: 'history',
|
|
base: '/zanui/vue/examples',
|
|
routes: routesConfig
|
|
});
|
|
router.beforeEach((to, from, next) => {
|
|
const container = document.querySelector('.examples-container');
|
|
if (container) {
|
|
document.querySelector('.examples-container').scrollTop = 0;
|
|
}
|
|
next()
|
|
});
|
|
|
|
new Vue({ // eslint-disable-line
|
|
render: h => h(App),
|
|
router
|
|
}).$mount('#app-container');
|