Skip to content

Commit

Permalink
[*] 自动路由回页面顶部
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami authored Oct 6, 2024
1 parent 65520fe commit 2f6e27d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,13 @@ const routes = [

const router = createRouter({
history: createWebHistory(),
routes
routes,
scrollBehavior(to, from, savedPosition) {
return {
top: 0,
behavior: 'smooth',
}
},
})

// // 检查本地存储是否存在token,若存在则直接使用
Expand Down

0 comments on commit 2f6e27d

Please sign in to comment.