mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
32 lines
708 B
JavaScript
32 lines
708 B
JavaScript
import Vue from 'vue';
|
|
import VueRouter from 'vue-router';
|
|
import App from './WapApp';
|
|
import routes from './router';
|
|
import '../../packages/vant-css/src/index.css';
|
|
import '../../packages/vant-css/src/icon-local.css';
|
|
import 'vant-doc/src/helper/touch-simulator';
|
|
import './components/nprogress.css';
|
|
|
|
const router = new VueRouter({
|
|
mode: 'hash',
|
|
base: '/zanui/vant/examples',
|
|
routes: routes(true)
|
|
});
|
|
|
|
router.afterEach(() => {
|
|
if (router.currentRoute.name) {
|
|
window.scrollTo(0, 0);
|
|
}
|
|
if (!router.currentRoute.redirectedFrom) {
|
|
Vue.nextTick(() => window.syncPath());
|
|
}
|
|
});
|
|
|
|
window.vueRouter = router;
|
|
|
|
new Vue({ // eslint-disable-line
|
|
render: h => h(App),
|
|
router,
|
|
el: '#app'
|
|
});
|