mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00

* feat: support lang entry build * feat: vant support lang switch * move lang iframe-router to utils & fix router link bug * add en-US config && add some translation * chang async. to async_ (support superman cdn) * add layout translation * change nav style * upgrade zan-doc * fix: doc config * upgrade zan-doc && remove useless code * fix changelog generate path
43 lines
867 B
JavaScript
43 lines
867 B
JavaScript
import Vue from 'vue';
|
|
import VueRouter from 'vue-router';
|
|
import App from './ExamplesDocsApp';
|
|
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'
|
|
});
|