Answer the question
In order to leave comments, you need to log in
Why is my pagination page not displaying correctly?
My example https://codesandbox.io/s/pyvjxxnnvj
Goes to /src/components/PaginationComponent.vue I have strange numbers displayed
That is, you click on 3, let's say the previous digit should appear 2, but it is not shown and the last digit is shown 3 If you take and click on 5, then nothing will happen except page 5, although it seems to me that slice should take a range of numbers
//PaginationComponent.vue:10
<li class="page-item" v-for="pageNumber in pages.slice(page - 1, page + 5)"><a class="page-link" @click.prevent="page = pageNumber">{{ pageNumber }}</a></li>
Answer the question
In order to leave comments, you need to log in
it seems to me that slice should take a range of numbers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question