From e00484d08a9d403dfe7c0b3003a9eaa865bbf39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Tue, 24 May 2022 11:09:45 +0800 Subject: [PATCH] update index.js --- src/router/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index af343bc..6921961 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -98,13 +98,13 @@ const router = createRouter({ history: createWebHistory( import.meta.env.VITE_APP_ROUTER_PREFIX), routes: constantRoutes, - // scrollBehavior(to, from, savedPosition) { - // if (savedPosition) { - // return savedPosition - // } else { - // return { top: 0 } - // } - // }, + scrollBehavior(to, from, savedPosition) { + if (savedPosition) { + return savedPosition + } else { + return { top: 0 } + } + }, }); export default router; \ No newline at end of file