File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function scrollTo (el) {
2424 . begin ( )
2525}
2626
27- function highlight ( ) {
27+ function highlight ( path ) {
2828 if ( ! enableScrollEvent ) return
2929 const sidebar = dom . getNode ( '.sidebar' )
3030 const anchors = dom . findAll ( '.anchor' )
@@ -45,7 +45,7 @@ function highlight () {
4545 }
4646 }
4747 if ( ! last ) return
48- const li = nav [ last . getAttribute ( 'data-id' ) ]
48+ const li = nav [ getNavKey ( path , last . getAttribute ( 'data-id' ) ) ]
4949
5050 if ( ! li || li === active ) return
5151
@@ -94,9 +94,9 @@ export function scrollActiveSidebar (router) {
9494 }
9595
9696 if ( isMobile ) return
97-
98- dom . off ( 'scroll' , highlight )
99- dom . on ( 'scroll' , highlight )
97+ const path = router . getCurrentPath ( )
98+ dom . off ( 'scroll' , ( ) => highlight ( path ) )
99+ dom . on ( 'scroll' , ( ) => highlight ( path ) )
100100 dom . on ( sidebar , 'mouseover' , ( ) => {
101101 hoverOver = true
102102 } )
You can’t perform that action at this time.
0 commit comments