Open kingwrcy opened 3 months ago
You need to add height and overflow attributes to the outer div to ensure that the page has enough space for scrolling
<div style="height: 400px; overflow: auto;" v-infinite-scroll="[onLoadMore, { distance: 10 }]">
<div v-for="item in data" :key="item">
{{ item }}
</div>
</div>
It seems that the examples on the official website do not add these two attributes.
I believe this behavior is expected. Even if you don't scroll, the callback will still be triggered to fetch more items and fill the remaining height.
The reproduction link you provided does not contain a valid example of the issue.
i have the same issue, It makes me feel insecure
Describe the bug
I haven't started scrolling the scroll bar yet, but it keeps calling the function onLoadMore in an infinite loop. The code is copied from the demo of the official website.
Reproduction
https://stackblitz.com/edit/vitejs-vite-jcnxvx?file=src%2FApp.vue
System Info
Used Package Manager
npm
Validations