add log and config docs

This commit is contained in:
yanyongyu
2020-08-20 15:07:05 +08:00
parent 1d982fc77b
commit 02ca49f6d0
20 changed files with 488 additions and 68 deletions

View File

@ -10,5 +10,20 @@ export default ({
router, // the router instance for the app
siteData // site metadata
}) => {
// ...apply enhancements for the site.
}
if (typeof process === "undefined" || process.env.VUE_ENV !== "server") {
router.onReady(() => {
const { app } = router;
app.$once("hook:mounted", () => {
// temporary fix for https://github.com/vuejs/vuepress/issues/2428
setTimeout(() => {
const { hash } = document.location;
if (hash.length > 1) {
const id = hash.substring(1);
const element = document.getElementById(id);
if (element) element.scrollIntoView();
}
}, 500);
});
});
}
};