I'm currently working on a dashboard that needs to display cards, but I'm running into an issue. I want only four cards visible at a time, and when you click the arrow, it should move just one step to the next card. For example, if cards 1-4 are showing, clicking the right arrow should reveal cards 2-5. However, my current setup jumps straight from 1-4 to 5-10 when the right arrow is clicked.
Here's what I have so far:
computed: {
cardsToDisplay(): Status[] {
return this.cards.slice(this.page * 4, (this.page + 1) * 4)
},
},
methods: {
setCards(no: number) {
this.page = this.page + delta
},
},
The left and right arrow buttons in the template look like this:
<v-icon v-if="page !==" class="black--text font-weight-bold"
@click="setPage(-1)">
chevron_left</v-icon>
<v-icon
v-if="columns.length > (page + 1) * 4"
class="black--text font-weight-bold"
@click="setPage(1)"
>chevron_right</v-icon
>
But how can I adjust it to smoothly move to the next card without skipping any? :)