Skip to content

Commit

Permalink
路由跳转后自动页面回归顶部
Browse files Browse the repository at this point in the history
  • Loading branch information
piexlmax committed Mar 9, 2023
1 parent 2c3f31e commit d51bd0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/src/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ router.beforeEach(async(to, from) => {

router.afterEach(() => {
// 路由加载完成后关闭进度条
document.getElementsByClassName('main-cont main-right')[0]?.scrollTo(0, 0)
Nprogress.done()
})

Expand Down
2 changes: 1 addition & 1 deletion web/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const routes = [{

const router = createRouter({
history: createWebHashHistory(),
routes
routes,
})

export default router

0 comments on commit d51bd0f

Please sign in to comment.