[Doc] sync render doc for search crawler

This commit is contained in:
陈嘉涵
2019-05-29 10:20:22 +08:00
parent fecc82e69b
commit 3bc5a93941
4 changed files with 30 additions and 169 deletions

View File

@@ -1,6 +1,6 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import VantDoc, { progress } from '@vant/doc';
import VantDoc from '@vant/doc';
import App from './DocsApp';
import routes from './router';
import { isMobile } from './utils';
@@ -16,13 +16,11 @@ router.beforeEach((route, redirect, next) => {
if (isMobile) {
location.replace('mobile.html' + location.hash);
}
progress.start();
document.title = route.meta.title || document.title;
next();
});
router.afterEach(() => {
progress.done();
window.scrollTo(0, 0);
Vue.nextTick(() => window.syncPath());
});