ElemeFE/vue-infinite-scroll

Fire v-infinite-scroll event even if infinite-scroll-disabled === true

Opened this issue · 3 comments

Hi,
I'm using vue-infinite-scroll, and I can see that v-infinite-scroll event is fired even if inifite-scroll-disabled === true.
Here is some console logs:

scroll disabled -> true
have to loadMore
scroll disabled -> true
scroll disabled -> false
have to loadMore
scroll disabled -> true
scroll disabled -> false
have to loadMore
scroll disabled -> true
have to loadMore
have to loadMore
have to loadMore
scroll disabled -> false

Thanks to look for the issue ! :)

Same problem for me.

this.disabled = true doesn't stop it.

You can, waiting this is fixed do this:

<div :infinite-scroll-immediate-check="false"
        :infinite-scroll-listen-for-event="true"
        v-infinite-scroll="handler"
        :infinite-scroll-disabled="loading"
        infinite-scroll-distance="2000">
</div>

And in js:

{
    methods: {
      handler () {
        if (this.loading) {
          return
        }
        this.loadNewData()
      }
    }
}

This avoid to call this.loadNewData 3-4 times before vue-infinite-scroll see that it's doesn't have to.
I know, this is ugly, but, I don't have another way. And it works for now :)

I get the same issue. Even :infinite-scroll-immediate-check="false" does not work anymore.