File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 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 {
4343 < p > Ant Motion</ p >
4444 </ div >
4545 < div className = "nav-wap" >
46- < Link className = "nav-list" location = "page0"
46+ < Link className = "nav-list" location = "page0" offset = { - 58 }
4747 onFocus = { this . onFocus . bind ( this ) }
4848 >
4949 Example
5050 </ Link >
51- < Link className = "nav-list" location = "page1"
51+ < Link className = "nav-list" location = "page1" offset = { - 58 }
5252 onFocus = { this . onFocus . bind ( this ) }
5353 >
5454 Example2
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class ScrollLink extends React.Component {
5050 const elementDom = mapped . get ( this . props . location ) ;
5151 const elementRect = elementDom . getBoundingClientRect ( ) ;
5252 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 ) ;
5454 this . toTop = this . props . toShowHeight ?
5555 toTop - transformArguments ( this . props . showHeightActive ) [ 0 ] : toTop ;
5656 this . initTime = Date . now ( ) ;
You can’t perform that action at this time.
0 commit comments