Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 42f63a8

Browse files
committedApr 15, 2018
fix: renderChildren / sidebarDepth: 0
1 parent ac4acab commit 42f63a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎lib/default-theme/SidebarLink.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export default {
1414
? selfActive || item.children.some(c => isActive($route, item.basePath + '#' + c.slug))
1515
: selfActive
1616
const link = renderLink(h, item.path, item.title || item.path, active)
17-
const configDepth = $page.frontmatter.sidebarDepth || $site.themeConfig.sidebarDepth
17+
const configDepth = $page.frontmatter.sidebarDepth != null
18+
? $page.frontmatter.sidebarDepth
19+
: $site.themeConfig.sidebarDepth
1820
const maxDepth = configDepth == null ? 1 : configDepth
1921
if (item.type === 'auto') {
2022
return [link, renderChildren(h, item.children, item.basePath, $route, maxDepth)]
@@ -47,7 +49,7 @@ function renderChildren (h, children, path, route, maxDepth, depth = 1) {
4749
const active = isActive(route, path + '#' + c.slug)
4850
return h('li', { class: 'sidebar-sub-header' }, [
4951
renderLink(h, '#' + c.slug, c.title, active),
50-
...renderChildren(h, c.children, path, route, maxDepth, depth + 1)
52+
renderChildren(h, c.children, path, route, maxDepth, depth + 1)
5153
])
5254
}))
5355
}

1 commit comments

Comments
 (1)

jackmahoney commented on Apr 16, 2020

@jackmahoney

I love Vuepress but we probably need more integration tests

Please sign in to comment.