ElemeFE / vue-infinite-scroll

An infinite scroll directive for vue.js.
2.86k stars 417 forks source link

Firing without reaching bottom #144

Open willPHPwork opened 4 years ago

willPHPwork commented 4 years ago

Firing with each scroll regardless of page height.

<template>
    <div class="business-list-wrapper">
        <div class="dd" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="5">
            <div 
            v-for="(d, i) in data" 
            :key="i"
            style="height:300px"
            >
            {{ d.name }}
            </div>
        </div>
    </div>
</template>
<script>
let count = 0;

export default {
  data() {
    return {
        data: [],
        busy: false
    }
  },
  methods: {
    loadMore: function() {
      this.busy = true;

      setTimeout(() => {
        for (var i = 0, j = 10; i < j; i++) {
          this.data.push({ name: count++ });
        }
        this.busy = false;
      }, 1000);
    }
  }
}
</script>
devapurva commented 3 years ago

I'm facing the same issue, loadMore is getting infinitely called.

jonalxh commented 3 years ago

Same here

devapurva commented 3 years ago

@Leopoldthecoder Please assign this issue to me. I'm trying to resolve this.

abdullah-336 commented 2 years ago

I'm facing the same issue here also, loadMore method is getting infinity called.