mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* [bugfix] Checkbox border render error in weixin browser * [bugfix] TreeSelect dependency path error * [bugfix] Swipe should clear autoplay timer when destroyed * [bugfix] Optimize component dependency analyze when build style entry * merge * update yarn.lock * update README.md * update README.md * update README.md * update README.md * update README.md * [Doc] add more badges in README.md * update README.md * [bugfix] Address & Contact list style * fix: contact test cases * [bugfix] popup style missing when build style entry * [bugfix] Search: onSearch event arguments missing * [Doc] add demo pages * update zan-doc@0.3.7 * fix: build entry error
43 lines
859 B
JavaScript
43 lines
859 B
JavaScript
import Vue from 'vue';
|
|
import VueRouter from 'vue-router';
|
|
import App from './DocsApp';
|
|
import routes from './router.config';
|
|
import ZanDoc from 'zan-doc';
|
|
import isMobile from './utils/is-mobile';
|
|
|
|
Vue.use(VueRouter);
|
|
Vue.use(ZanDoc);
|
|
|
|
const routesConfig = routes();
|
|
|
|
const router = new VueRouter({
|
|
mode: 'hash',
|
|
base: '/zanui/vue/',
|
|
routes: routesConfig
|
|
});
|
|
|
|
router.beforeEach((route, redirect, next) => {
|
|
if (isMobile) {
|
|
window.location.replace('/zanui/vue/examples');
|
|
}
|
|
document.title = route.meta.title || document.title;
|
|
next();
|
|
});
|
|
|
|
router.afterEach(() => {
|
|
window.scrollTo(0, 0);
|
|
Vue.nextTick(() => window.syncPath());
|
|
});
|
|
|
|
window.vueRouter = router;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
Vue.config.productionTip = false;
|
|
}
|
|
|
|
new Vue({ // eslint-disable-line
|
|
render: h => h(App),
|
|
router,
|
|
el: '#app-container'
|
|
});
|