From 94ec6fab5cd91ad7a65b7fb3931609ce363e4fe1 Mon Sep 17 00:00:00 2001 From: lightnoway Date: Tue, 15 Oct 2024 16:58:34 +0800 Subject: [PATCH] Update route.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果 `next({ path: from.fullPath, replace: true, query: from.query, hash: to.hash });` 的意图是取消跳转的话 使用 next(false) 更准确。 而使用replace ,也许会和用户代码 一起产生 非预期的可能 --- src/router/guard/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/guard/route.ts b/src/router/guard/route.ts index 68f36047..e099a860 100644 --- a/src/router/guard/route.ts +++ b/src/router/guard/route.ts @@ -189,7 +189,7 @@ function handleRouteSwitch(to: RouteLocationNormalized, from: RouteLocationNorma if (to.meta.href) { window.open(to.meta.href, '_blank'); - next({ path: from.fullPath, replace: true, query: from.query, hash: to.hash }); + next(false); return; }