From 9e892397c8e3717b6d623490155d51822e07e7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Tue, 12 Nov 2024 16:01:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useRouteItem.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/useRouteItem.ts b/src/hooks/useRouteItem.ts index 3f527c3..3beb064 100644 --- a/src/hooks/useRouteItem.ts +++ b/src/hooks/useRouteItem.ts @@ -10,6 +10,7 @@ import { unref } from 'vue' import { useStore } from 'vuex' import { useRoute } from 'vue-router' import { pathToRegexp } from 'path-to-regexp' +import { isExternalLink } from 'utils/resolvePath' export default function () { const store = useStore() @@ -20,6 +21,9 @@ export default function () { const item = unref(routeMap)[route.path] if (item) return item for (const path in unref(routeMap)) { + if (isExternalLink(path)) { + continue + } const reg = pathToRegexp(path) if (reg.exec(route.path)) { return unref(routeMap)[path]