SSR-403 Fix issue where page doesn't load at top...

of next page when changing routes.
This commit is contained in:
Bryan Mauger 2023-04-14 08:54:07 -04:00
parent 32a5bbfdb7
commit 0f85033fdd

View file

@ -74,6 +74,10 @@ const routes = [
const router = createRouter({ const router = createRouter({
history: createWebHistory("/"), history: createWebHistory("/"),
routes, routes,
scrollBehavior(to, from, savedPosition) {
// always scroll to top
return { top: 0 }
},
}); });
router.afterEach((to, from) => { router.afterEach((to, from) => {