- router scroll behaviour

This commit is contained in:
Arno Kaimbacher 2021-12-06 17:38:53 +01:00
parent be6bb2bdc4
commit ed394e9587
4 changed files with 10 additions and 5 deletions

View file

@ -60,6 +60,10 @@ const routes = [
const router = createRouter({
history: createWebHistory(),
routes,
scrollBehavior(to, from, savedPosition) {
// return desired position
document.getElementById("app")?.scrollIntoView();
},
});
export default router;