diff --git a/src/sites/mobile/router.ts b/src/sites/mobile/router.ts index 6655dfa086..882e1a1fb5 100644 --- a/src/sites/mobile/router.ts +++ b/src/sites/mobile/router.ts @@ -50,6 +50,14 @@ routes.push({ const router = createRouter({ history: createWebHashHistory(), + scrollBehavior(to, from, savedPosition) { + // 始终滚动到顶部 + if (savedPosition) { + return savedPosition; + } else { + return { top: 0 }; + } + }, routes });