切换路由之后滚动条始终在最顶部

master
liuyx 2 years ago
parent 444a8cca93
commit 486c56f31e

@ -32,4 +32,8 @@ const router = createRouter({
routes routes
}) })
router.afterEach(() => {
window.scrollTo(0, 0) // 切换路由之后滚动条始终在最顶部
})
export default router export default router

Loading…
Cancel
Save