- Before we start integrating the infinite scroll, let’s fetch and set some initial data on page load: – – It’s worth noting that it’s not recommended to make five services calls on load.
- We’ll make use of the document object’s , properties and of window’s properties to determine if scroll as at the bottom: – – Inside this condition, let’s add a service method with Axios to fetch another random user from the Random User API.
- This function makes a service call and adds a new random “user” to the array only when the user scrolls to the bottom of the page.
- With each scroll to the bottom of the page, we fetch new data with Axios then push that data to an array.
Continue reading “Implementing an Infinite Scroll with Vue.js ← Alligator.io”