File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 4949 if (dir === ' top' ) {
5050 distance = scrollTop;
5151 } else {
52- const styles = getComputedStyle (elm === window ? document .body : elm);
53- const innerHeight = elm === window
54- ? window .innerHeight
55- : parseInt (styles .height , 10 );
56- const scrollHeight = elm === window
57- ? document .body .scrollHeight
58- : elm .scrollHeight ;
59- const paddingTop = parseInt (styles .paddingTop , 10 );
60- const paddingBottom = parseInt (styles .paddingBottom , 10 );
52+ const scrollElmHeight = elm === window ?
53+ window .innerHeight :
54+ elm .getBoundingClientRect ().height ;
6155
62- distance = scrollHeight - innerHeight - scrollTop - paddingTop - paddingBottom ;
56+ distance = this . $el . offsetTop - scrollTop - scrollElmHeight - ( elm . offsetTop || 0 ) ;
6357 }
6458
6559 return distance;
129123 },
130124 methods: {
131125 attemptLoad () {
132- const currentDistance = getCurrentDistance (this .scrollParent , this .direction );
126+ const currentDistance = getCurrentDistance . bind ( this ) (this .scrollParent , this .direction );
133127 if (! this .isComplete && currentDistance <= this .distance ) {
134128 this .isLoading = true ;
135129 this .onInfinite .call ();
You can’t perform that action at this time.
0 commit comments