ElemeFE/vue-infinite-scroll

Only executes when scrolling down to the page

Closed this issue · 2 comments

Currently It excutes function inside v-infinite-scroll each time the scroll event is emitted no matter what the direction is (both up and down).

But we do only want it when we scroll down to the page, am I right?

Currently It has a throttle of scroll listener, it will only fire once in 200ms.

I think "scroll down" should be judge by scrollTop change.Normally, you are right, but think about some edge conditions.

<ul>
  <li v-for="item in items">{{ item.text }}</li>
</ul>

When one of item's text changed, from a long text to an empty string. The scrollTop may be decreased, but infinite scroll should trigger a load method.

Ok it's fine then.