@@ -14,7 +14,9 @@ export default {
14
14
? selfActive || item .children .some (c => isActive ($route, item .basePath + ' #' + c .slug ))
15
15
: selfActive
16
16
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
18
20
const maxDepth = configDepth == null ? 1 : configDepth
19
21
if (item .type === ' auto' ) {
20
22
return [link, renderChildren (h, item .children , item .basePath , $route, maxDepth)]
@@ -47,7 +49,7 @@ function renderChildren (h, children, path, route, maxDepth, depth = 1) {
47
49
const active = isActive (route, path + ' #' + c .slug )
48
50
return h (' li' , { class: ' sidebar-sub-header' }, [
49
51
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 )
51
53
])
52
54
}))
53
55
}
0 commit comments