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})`)