fix(theme): incorrect link parsing in breadcrumb nav, close #369 (#373)

This commit is contained in:
pengzhanbo 2024-12-15 00:10:15 +08:00 committed by GitHub
parent 52a9d15fee
commit 71304ee160
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,7 @@
import type { ResolvedSidebarItem } from '../../shared/index.js'
import VPLink from '@theme/VPLink.vue'
import { computed } from 'vue'
import { resolveRouteFullPath } from 'vuepress/client'
import {
useBlogPageData,
useData,
@ -55,7 +56,8 @@ function resolveSidebar(
result: Breadcrumb[] = [],
): Breadcrumb[] | null {
for (const item of sidebar) {
if (item.link === page.value.path) {
const link = item.link ? resolveRouteFullPath(item.link) : undefined
if (link === page.value.path) {
return result
}
else if (item.items) {