mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-09 14:22:40 +02:00
18 lines
527 B
JavaScript
18 lines
527 B
JavaScript
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);
|
|
});
|
|
});
|
|
}
|
|
}
|