From 2f6e27d8eb48faf61acd7fe4b00f38f30bbad715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz?= Date: Mon, 7 Oct 2024 07:34:37 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20=E8=87=AA=E5=8A=A8=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=9B=9E=E9=A1=B5=E9=9D=A2=E9=A1=B6=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 34b13d8..773b544 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -284,7 +284,13 @@ const routes = [ const router = createRouter({ history: createWebHistory(), - routes + routes, + scrollBehavior(to, from, savedPosition) { + return { + top: 0, + behavior: 'smooth', + } + }, }) // // 检查本地存储是否存在token,若存在则直接使用