vant/docs/src/index.js
neverland 0da517e004 [Doc] add demo pages (#237)
* [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
2017-10-24 02:27:04 -05:00

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'
});