File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 4848 if (dir === ' top' ) {
4949 distance = scrollTop;
5050 } else {
51- const styles = getComputedStyle (elm === window ? document .body : elm);
52- const innerHeight = elm === window
53- ? window .innerHeight
54- : parseInt (styles .height , 10 );
55- const scrollHeight = elm === window
56- ? document .body .scrollHeight
57- : elm .scrollHeight ;
58- const paddingTop = parseInt (styles .paddingTop , 10 );
59- const paddingBottom = parseInt (styles .paddingBottom , 10 );
60- distance = scrollHeight - innerHeight - scrollTop - paddingTop - paddingBottom;
51+ const scrollElmHeight = elm === window ?
52+ window .innerHeight :
53+ elm .getBoundingClientRect ().height ;
54+
55+ distance = this .$el .offsetTop - scrollTop - scrollElmHeight - (elm .offsetTop || 0 );
6156 }
6257 return distance;
6358 }
122117 },
123118 methods: {
124119 attemptLoad () {
125- const currentDistance = getCurrentDistance (this .scrollParent , this .direction );
120+ const currentDistance = getCurrentDistance . bind ( this ) (this .scrollParent , this .direction );
126121 if (! this .isComplete && currentDistance <= this .distance ) {
127122 this .isLoading = true ;
128123 this .onInfinite .call ();
You can’t perform that action at this time.
0 commit comments