Skip to content

Commit 1fe8a17

Browse files
committed
Fix the scrollTop calculate error
1 parent 63438ef commit 1fe8a17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/InfiniteLoading.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
const scrollHeight = elm === window
3434
? document.body.scrollHeight
3535
: elm.scrollHeight;
36+
const scrollTop = isNaN(elm.scrollTop) ? elm.pageYOffset : elm.scrollTop;
3637
37-
return scrollHeight - innerHeight - (elm.scrollTop || elm.pageYOffset);
38+
return scrollHeight - innerHeight - scrollTop;
3839
}
3940
4041
export default {

0 commit comments

Comments
 (0)