Skip to content

Commit b5abb5b

Browse files
committed
Modify the attempt logic to disable load when this component is invisible #93
1 parent 6da4c43 commit b5abb5b

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
@@ -263,7 +263,8 @@
263263
attemptLoad(isContinuousCall) {
264264
const currentDistance = this.getCurrentDistance();
265265
266-
if (!this.isComplete && currentDistance <= this.distance) {
266+
if (!this.isComplete && currentDistance <= this.distance &&
267+
(this.$el.offsetWidth + this.$el.offsetHeight) > 0) {
267268
this.isLoading = true;
268269
269270
if (typeof this.onInfinite === 'function') {

0 commit comments

Comments
 (0)