From 07710247bbb020cd6b4f2b9604900d1e4015b252 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 5 Dec 2025 17:16:48 +0800 Subject: [PATCH] fix(theme): fix parsing error for relative path link (#779) --- theme/src/client/composables/link.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/theme/src/client/composables/link.ts b/theme/src/client/composables/link.ts index 2b6411f9..c9e521d4 100644 --- a/theme/src/client/composables/link.ts +++ b/theme/src/client/composables/link.ts @@ -64,7 +64,8 @@ export function useLink( // 判断是否为不存在的路由 const routePath = link.split(/[?#]/)[0] - const { notFound } = resolveRoute(routePath) + const currentPath = page.value.filePathRelative ? `/${page.value.filePathRelative}` : undefined + const { notFound } = resolveRoute(routePath, currentPath) if (__VUEPRESS_DEV__) notFound && console.warn(`[VuePress Dead Link] "${toValue(href)}" is not found in (${page.value.filePathRelative || page.value.path})`)