Skip to content

Commit

Permalink
Fix router scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Sep 12, 2023
1 parent e167664 commit 111877f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export function createRouter() {
history: getHistory(),
routes,
scrollBehavior(to, from, savedPosition) {
if (to.hash) {
return { el: to.hash }
}
return to.hash
? { el: to.hash }
: { top: 0 }
}
})
}

0 comments on commit 111877f

Please sign in to comment.