diff --git a/src/router.js b/src/router.js index 134fe92..d829e94 100644 --- a/src/router.js +++ b/src/router.js @@ -63,8 +63,15 @@ const routes = [ ]; const router = createRouter({ - history: createWebHistory(), + history: createWebHistory(import.meta.env.BASE_URL), routes, + scrollBehavior(to, from, savedPosition) { + if (savedPosition) { + return savedPosition + } + + return { top: 0 } + } }); export default router; \ No newline at end of file