Fix issue where "page" does not begin at top when...

changing routes.
This commit is contained in:
Bryan Mauger 2023-04-14 09:52:24 -04:00
parent ba27aae0f5
commit 3eb7df9f21

View file

@ -161,6 +161,11 @@ const routes = [
const router = createRouter({ const router = createRouter({
history: createWebHistory("/fmg/"), history: createWebHistory("/fmg/"),
routes, routes,
//Cause "page" to begin at the top when route chanages.
scrollBehavior(to, from, savedPosition) {
// always scroll to top
return { top: 0 }
},
}); });
//---------------------------------------------------------- Router Functions ---------------------------------------------------------- //---------------------------------------------------------- Router Functions ----------------------------------------------------------