mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-15 17:22:56 +02:00
fix anchor links
This commit is contained in:
parent
9904849e8f
commit
74e75139d3
1 changed files with 18 additions and 0 deletions
18
docs/.vuepress/enhanceApp.js
Normal file
18
docs/.vuepress/enhanceApp.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
export default ({ router }) => {
|
||||||
|
if(typeof process === 'undefined' || process.env.VUE_ENV !== 'server') {
|
||||||
|
router.onReady(() => {
|
||||||
|
const { app } = router;
|
||||||
|
|
||||||
|
app.$once("hook:mounted", () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
const { hash } = document.location;
|
||||||
|
if (hash.length > 1) {
|
||||||
|
const id = decodeURIComponent(hash.substring(1));
|
||||||
|
const element = document.getElementById(id);
|
||||||
|
if (element) element.scrollIntoView();
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue