diff --git a/lib/app/composables/router.js b/lib/app/composables/router.js index b451cf7c..028576e5 100644 --- a/lib/app/composables/router.js +++ b/lib/app/composables/router.js @@ -102,9 +102,18 @@ function loadPage(route, scrollPosition = 0) { if (route.path === pendingPath) { route.contentComponent = m.default route.pageData = m.__pageData - - console.log(route.pageData) await nextTick() + + if (location.hash && !scrollPosition) { + /** + * @type {HTMLElement | null} + */ + const target = document.querySelector(location.hash) + if (target) { + scrollPosition = target.offsetTop + } + } + window.scrollTo({ left: 0, top: scrollPosition,