File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function scrollTo (el) {
24
24
. begin ( )
25
25
}
26
26
27
- function highlight ( ) {
27
+ function highlight ( path ) {
28
28
if ( ! enableScrollEvent ) return
29
29
const sidebar = dom . getNode ( '.sidebar' )
30
30
const anchors = dom . findAll ( '.anchor' )
@@ -45,7 +45,7 @@ function highlight () {
45
45
}
46
46
}
47
47
if ( ! last ) return
48
- const li = nav [ last . getAttribute ( 'data-id' ) ]
48
+ const li = nav [ getNavKey ( path , last . getAttribute ( 'data-id' ) ) ]
49
49
50
50
if ( ! li || li === active ) return
51
51
@@ -94,9 +94,9 @@ export function scrollActiveSidebar (router) {
94
94
}
95
95
96
96
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 ) )
100
100
dom . on ( sidebar , 'mouseover' , ( ) => {
101
101
hoverOver = true
102
102
} )
You can’t perform that action at this time.
0 commit comments