Skip to content

Commit d51bd0f

Browse files
author
piexlmax
committed
路由跳转后自动页面回归顶部
1 parent 2c3f31e commit d51bd0f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

web/src/permission.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ router.beforeEach(async(to, from) => {
101101

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

web/src/router/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const routes = [{
1818

1919
const router = createRouter({
2020
history: createWebHashHistory(),
21-
routes
21+
routes,
2222
})
2323

2424
export default router

0 commit comments

Comments
 (0)