File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -329,13 +329,17 @@ export class Compiler {
329
329
* Compile sidebar
330
330
*/
331
331
sidebar ( text , level ) {
332
+ const { toc} = this
332
333
const currentPath = this . router . getCurrentPath ( )
333
334
let html = ''
334
335
335
336
if ( text ) {
336
337
html = this . compile ( text )
337
338
} else {
338
- const tree = this . cacheTree [ currentPath ] || genTree ( this . toc , level )
339
+ for ( let i = 0 ; i < toc . length ; i ++ ) {
340
+ toc [ i ] . ignoreSubHeading && toc . splice ( i , 1 ) && i --
341
+ }
342
+ const tree = this . cacheTree [ currentPath ] || genTree ( toc , level )
339
343
html = treeTpl ( tree , '<ul>{inner}</ul>' )
340
344
this . cacheTree [ currentPath ] = tree
341
345
}
@@ -360,7 +364,6 @@ export class Compiler {
360
364
for ( let i = 0 ; i < toc . length ; i ++ ) {
361
365
toc [ i ] . ignoreSubHeading && toc . splice ( i , 1 ) && i --
362
366
}
363
-
364
367
const tree = cacheTree [ currentPath ] || genTree ( toc , level )
365
368
366
369
cacheTree [ currentPath ] = tree
You can’t perform that action at this time.
0 commit comments