refactor: add smooth scroll when a route is changed

This commit is contained in:
Łukasz Holeczek
2021-11-01 12:41:27 +01:00
parent 0712ea9524
commit cfd1a98dd5
+4
View File
@@ -293,6 +293,10 @@ const routes = [
const router = createRouter({
history: createWebHashHistory(process.env.BASE_URL),
routes,
scrollBehavior() {
// always scroll to top
return { top: 0 }
},
})
export default router