Akryum / vue-virtual-scroller

⚡️ Blazing fast scrolling for any amount of data
https://vue-virtual-scroller-demo.netlify.app
9.78k stars 916 forks source link

Lazy load data when getting close to the bottom #335

Open rogeralsing opened 4 years ago

rogeralsing commented 4 years ago

Is there any good way to detect when you are getting within x pixels of the bottom so you can start loading more data?

My current approach is to have an element below the scroller and once that is visible, I trigger the lazy load to fetch more data.

However, this is suboptimal as this element first needs to be visible, which means there are no more rows on the screen.

A better way would be to start fetching earlier. but I don't know how to accomplish this with vue-virtual-scroller.

Thoughts?

invisor commented 4 years ago

@rogeralsing add an event which will fire on bottom scroll reach. Using this event you will able to load additional data https://github.com/Akryum/vue-virtual-scroller/issues/144