I have the following problem: When I click on a new component link the router-view will not scroll to 0,0, but it will keep the scrolling state of the old component. It's supposed to move to the top but it doesn't...
This is my router in vue
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return { x: 0, y: 0 }
}
}
})
Thanks for your help!