File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/@vuepress/theme-default/components Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,23 @@ export default {
7777function resolveOpenGroupIndex (route , items ) {
7878 for (let i = 0 ; i < items .length ; i++ ) {
7979 const item = items[i]
80- if (item . type === ' group ' && item . children . some ( c => c . type === ' page ' && isActive ( route, c . path ) )) {
80+ if (descendantIsActive ( route, item )) {
8181 return i
8282 }
8383 }
8484 return - 1
8585}
86+
87+ function descendantIsActive (route , item ) {
88+ if (item .type === ' group' ) {
89+ return item .children .some (child => {
90+ if (child .type === ' group' ) {
91+ return descendantIsActive (route, child)
92+ } else {
93+ return child .type === ' page' && isActive (route, child .path )
94+ }
95+ })
96+ }
97+ return false
98+ }
8699 </script >
You can’t perform that action at this time.
0 commit comments