vant-weapp/docs/src/index.js
2019-01-02 21:48:30 +08:00

31 lines
542 B
JavaScript

import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
import routes from './router';
import VantDoc, { progress } from '@vant/doc';
Vue.use(VueRouter).use(VantDoc);
const router = new VueRouter({
mode: 'hash',
routes: routes()
});
router.beforeEach((route, redirect, next) => {
progress.start();
next();
});
router.afterEach(() => {
progress.done();
window.scrollTo(0, 0);
});
Vue.config.productionTip = false;
new Vue({ // eslint-disable-line
render: h => h(App),
router,
el: '#app'
});