File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,12 @@ class Demo extends React.Component {
43
43
< p > Ant Motion</ p >
44
44
</ div >
45
45
< div className = "nav-wap" >
46
- < Link className = "nav-list" location = "page0"
46
+ < Link className = "nav-list" location = "page0" offset = { - 58 }
47
47
onFocus = { this . onFocus . bind ( this ) }
48
48
>
49
49
Example
50
50
</ Link >
51
- < Link className = "nav-list" location = "page1"
51
+ < Link className = "nav-list" location = "page1" offset = { - 58 }
52
52
onFocus = { this . onFocus . bind ( this ) }
53
53
>
54
54
Example2
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class ScrollLink extends React.Component {
50
50
const elementDom = mapped . get ( this . props . location ) ;
51
51
const elementRect = elementDom . getBoundingClientRect ( ) ;
52
52
this . scrollTop = currentScrollTop ( ) ;
53
- const toTop = Math . round ( elementRect . top ) - Math . round ( docRect . top ) ;
53
+ const toTop = Math . round ( elementRect . top ) - Math . round ( docRect . top ) + Math . round ( this . props . offset ? this . props . offset : 0 ) ;
54
54
this . toTop = this . props . toShowHeight ?
55
55
toTop - transformArguments ( this . props . showHeightActive ) [ 0 ] : toTop ;
56
56
this . initTime = Date . now ( ) ;
You can’t perform that action at this time.
0 commit comments