SSR-403 Fix issue where page doesn't load at top...
of next page when changing routes.
This commit is contained in:
parent
32a5bbfdb7
commit
0f85033fdd
1 changed files with 17 additions and 13 deletions
|
|
@ -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) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue