Restore scroll position after page change

This commit is contained in:
styppo 2023-01-18 21:14:58 +00:00
parent 171f53b5a1
commit c878c92911
No known key found for this signature in database
GPG Key ID: 3AAA685C50724C28

View File

@ -17,7 +17,13 @@ export default route(function (/* { store, ssrContext } */) {
: (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory)
const Router = createRouter({
scrollBehavior: () => ({ left: 0, top: 0 }),
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return { top: 0 }
}
},
routes,
// Leave this as is and make changes in quasar.conf.js instead!