File tree 5 files changed +7
-5
lines changed
5 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,9 @@ const showSidebar = computed(() => {
135
135
136
136
const { themeConfig } = siteRouteData .value
137
137
138
- return ! isSideBarEmpty (getSideBarConfig (themeConfig .sidebar , route .path ))
138
+ return ! isSideBarEmpty (
139
+ getSideBarConfig (themeConfig .sidebar , route .data .relativePath )
140
+ )
139
141
})
140
142
141
143
const toggleSidebar = (to ? : boolean ) => {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export const SideBarLink: FunctionalComponent<{
18
18
const text = props . item . text
19
19
const link = resolveLink ( site . value . base , props . item . link )
20
20
const children = ( props . item as DefaultTheme . SideBarGroup ) . children
21
- const active = isActive ( route , link )
21
+ const active = isActive ( route , props . item . link )
22
22
const childItems = createChildren ( active , children , headers )
23
23
24
24
return h ( 'li' , { class : 'sidebar-link' } , [
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export function useNavLink(item: Ref<DefaultTheme.NavItemWithLink>) {
11
11
const isExternal = isExternalCheck ( item . value . link )
12
12
13
13
const props = computed ( ( ) => {
14
- const routePath = normalizePath ( route . path )
14
+ const routePath = normalizePath ( `/ ${ route . data . relativePath } ` )
15
15
16
16
let active = false
17
17
if ( item . value . activeMatch ) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export function useSideBar() {
30
30
// now, there's no sidebar setting at frontmatter; let's see the configs
31
31
const themeSidebar = getSideBarConfig (
32
32
site . value . themeConfig . sidebar ,
33
- route . path
33
+ route . data . relativePath
34
34
)
35
35
36
36
if ( themeSidebar === false ) {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export function isActive(route: Route, path?: string): boolean {
22
22
return false
23
23
}
24
24
25
- const routePath = normalize ( route . path )
25
+ const routePath = normalize ( `/ ${ route . data . relativePath } ` )
26
26
const pagePath = normalize ( path )
27
27
28
28
return routePath === pagePath
You can’t perform that action at this time.
0 commit comments