Skip to content

Commit 64225f3

Browse files
richardo2016Leopoldthecoder
authored andcommitted
robust for throttleDelay computation, then add its explanation to README.md
1 parent e788265 commit 64225f3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ new Vue({
9292
| infinite-scroll-distance | Number(default = 0) - the minimum distance between the bottom of the element and the bottom of the viewport before the v-infinite-scroll method is executed. |
9393
| infinite-scroll-immediate-check | Boolean(default = true) - indicates that the directive should check immediately after bind. Useful if it's possible that the content is not tall enough to fill up the scrollable container. |
9494
| infinite-scroll-listen-for-event | infinite scroll will check again when the event is emitted in Vue instance. |
95+
| infinite-scroll-throttle-delay | Number(default = 200) - interval(ms) between next time checking and this time |
9596

9697
## Development
9798

src/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var doBind = function () {
9797
var throttleDelay = 200;
9898
if (throttleDelayExpr) {
9999
throttleDelay = Number(directive.vm[throttleDelayExpr] || throttleDelayExpr);
100-
if (isNaN(throttleDelay)) {
100+
if (isNaN(throttleDelay) || throttleDelay < 0) {
101101
throttleDelay = 200;
102102
}
103103
}

0 commit comments

Comments
 (0)