oumoussa98 / vue3-infinite-loading

Infinite scroll component compatible with vuejs-3 and vitejs
https://vue3-infinite-loading.netlify.app/
191 stars 31 forks source link

Add feature to manually load data with button #81

Open Jordan-Ellis opened 7 months ago

Jordan-Ellis commented 7 months ago

A common paradigm for infinite scroll is to require the user to click a load more button before infinite scrolling starts. This prevents an issue where somebody can never reach the footer of the website.

This pull requests adds a manualload prop and loadMore slot. When manualload is true, the loadMore slot will be shown which contains a button to load more items. The user has to manually click the button in order to load more, instead of the infinite scroll automatically loading.

This prop has to be manually set which allows for different use cases. For example, within the load function you set manualload to false after the user clicks the button, enabling infinite scroll after the first click. Or you can keep it set to true, essentially turning the component into a load more button that handles all the state.

netlify[bot] commented 7 months ago

Deploy Preview for vue3-infinite-loading-demo ready!

Name Link
Latest commit d04194533a7603647522c01f4d098b1996d2ae79
Latest deploy log https://app.netlify.com/sites/vue3-infinite-loading-demo/deploys/65ff722c9c9b400008334084
Deploy Preview https://deploy-preview-81--vue3-infinite-loading-demo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.