From d04ba7563a3d83153b1203c1102229739dcf998a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E4=B8=87?= <52823142+Ten-K@users.noreply.github.com> Date: Tue, 30 Nov 2021 21:42:30 +0800 Subject: [PATCH] fix: router refresh (#136) --- src/router/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index f70f386c5..dbc246d23 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -234,7 +234,13 @@ router.beforeEach((to, _from, next) => { if (usePermissionStoreHook().wholeRoutes.length === 0) initRouter(name.username).then((router: Router) => { if (!useMultiTagsStoreHook().getMultiTagsCache) { - return router.push("/"); + useMultiTagsStoreHook().handleTags("push", { + path: to.path, + parentPath: to.matched[0]?.path, + name: to.name, + meta: to.meta + }); + return router.push(to.path); } router.push(to.path); // 刷新页面更新标签栏与页面路由匹配