diff --git a/web/src/router/index.js b/web/src/router/index.js index 8b3b0d1..0f1d2a3 100644 --- a/web/src/router/index.js +++ b/web/src/router/index.js @@ -13,5 +13,9 @@ const routes = [ export default createRouter({ history: createWebHistory(), - routes + routes, + scrollBehavior() { + // 每次路由切换滚动到顶部 + return { top: 0 } + } })