Skip to content

Commit

Permalink
Fix expand nested children in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Coffeephile committed Jul 17, 2019
1 parent 667d9f4 commit 6b3bd66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/@vuepress/theme-default/components/SidebarLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ export default {
function resolveOpenGroupIndex (route, items) {
for (let i = 0; i < items.length; i++) {
const item = items[i]
if (item.type === 'group' && item.children.some(c => c.type === 'page' && isActive(route, c.path))) {
if (item.type === 'group' && item.children
&& (item.children.some(c => c.type === 'page' && isActive(route, c.path))
|| resolveOpenGroupIndex(route, item.children) > -1)
) {
return i
}
}
Expand Down

0 comments on commit 6b3bd66

Please sign in to comment.