refactor: add smooth scroll when a route is changed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user