R
R
Ruslan Absalyamov2018-11-07 14:15:26
Vue.js
Ruslan Absalyamov, 2018-11-07 14:15:26

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

1 answer(s)
A
Alexey Yarkov, 2018-11-07
@rusline18

it seems to me that slice should take a range of numbers

And it is weak to read to dock that there was a confidence, instead of "it seems to me"?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question