mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
[Build] dynamic import (#1168)
This commit is contained in:
@@ -3,6 +3,7 @@ import VueRouter from 'vue-router';
|
||||
import App from './DocsApp';
|
||||
import routes from './router';
|
||||
import VantDoc from 'vant-doc';
|
||||
import progress from 'nprogress';
|
||||
import { isMobile } from './utils';
|
||||
import './components/nprogress.css';
|
||||
|
||||
@@ -18,11 +19,13 @@ router.beforeEach((route, redirect, next) => {
|
||||
if (isMobile) {
|
||||
location.replace(location.pathname === '/' ? 'examples.html' : '/zanui/vant/examples' + location.hash);
|
||||
}
|
||||
progress.start();
|
||||
document.title = route.meta.title || document.title;
|
||||
next();
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
progress.done();
|
||||
window.scrollTo(0, 0);
|
||||
Vue.nextTick(() => window.syncPath());
|
||||
});
|
||||
|
Reference in New Issue
Block a user