add router scrollBehavior
Main daploy / deploy (push) Successful in 51s

This commit is contained in:
2024-11-26 21:00:52 +02:00
parent 16a0fa76de
commit 62decae014
+7
View File
@@ -93,6 +93,13 @@ const routes = [
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
routes, routes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return { top: 0, behavior: 'smooth' }
}
},
}) })
export default router export default router