[Doc] support title anchor (#3845)

This commit is contained in:
neverland
2019-07-13 20:41:15 +08:00
committed by GitHub
parent 0d2f010e44
commit 7b9331aee4
5 changed files with 71 additions and 29 deletions

View File

@@ -31,6 +31,10 @@ export function initIframeRouter() {
window.changePath = function (lang, path = '') {
setLang(lang);
window.vueRouter.replace(path);
// should preserve hash for anchor
if (window.vueRouter.currentRoute.path !== path) {
window.vueRouter.replace(path);
}
};
}