Skip to content

Commit fa8797e

Browse files
committed
Modify the on-infinite function to required
1 parent 7193934 commit fa8797e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/InfiniteLoading.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@
7474
type: Number,
7575
default: 100,
7676
},
77-
onInfinite: Function,
77+
onInfinite: {
78+
type: Function,
79+
required: true,
80+
},
7881
spinner: String,
7982
},
8083
ready() {
@@ -84,9 +87,7 @@
8487
const currentDistance = getCurrentDistance(this.scrollParent);
8588
if (!this.isLoading && currentDistance <= this.distance) {
8689
this.isLoading = true;
87-
if (this.onInfinite) {
88-
this.onInfinite.call();
89-
}
90+
this.onInfinite.call();
9091
}
9192
}.bind(this);
9293

0 commit comments

Comments
 (0)