T
T
TuMko2020-07-29 16:48:18
Vue.js
TuMko, 2020-07-29 16:48:18

How to show/load more posts in Vue.js?

Hello. Vue.js project. A list of users in the amount of 10 people is displayed. The list is taken to the server in the form url/users?page=1&count=10. It is necessary to additionally load the next 10 people by pressing the button. from the list, etc., until the list ends, then hide the button.
I can’t figure out how to implement this correctly: either change the count to +10, or change the page to +1, but then you need to somehow leave users from the previous page, or something else ... How to implement this correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
approximate solution, 2020-07-29
@approximate_solution

https://vuejsexamples.com/tag/pagination/
https://webformyself.com/paginaciya-s-pomoshhyu-vuejs/
https://habr.com/en/post/417119/

R
Red_Devi1, 2020-08-01
@Red_Devi1

https://www.youtube.com/watch?v=6juVZFPBj4Q - use it.
If pagination is not needed, it's probably easier to increase the count >> cut the last 10 users from the response and push the result into an array that stores a list of users

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question