BeanFeed
BeanFeed
NNuxt
Created by BeanFeed on 11/4/2024 in #❓・help
Pagination page count not updating
I am trying to change the :total field of my UPagination component and its not updating. Here is my implementation.
<template v-if="transactionsCount > 1">
<div class="mt-2">
<UPagination class="" v-model="state.page" max="3" :total="transactionsCount"/>
</div>
</template>

<script setup lang="js">
//The amount of pages with transactions. Max 10 transactions per page.
const transactionsCount = ref(0)
//initially when the page loads, transactionsCount is set to 1 by another function.
//When a user clicks a check box, it loads 30 transactions, so transactionsCount is set to 3. The pagination is not updating.
//Looked at the values in the nuxt dev tools, all the variables are as expected. This just isn't reflecting that.
</script>
<template v-if="transactionsCount > 1">
<div class="mt-2">
<UPagination class="" v-model="state.page" max="3" :total="transactionsCount"/>
</div>
</template>

<script setup lang="js">
//The amount of pages with transactions. Max 10 transactions per page.
const transactionsCount = ref(0)
//initially when the page loads, transactionsCount is set to 1 by another function.
//When a user clicks a check box, it loads 30 transactions, so transactionsCount is set to 3. The pagination is not updating.
//Looked at the values in the nuxt dev tools, all the variables are as expected. This just isn't reflecting that.
</script>
8 replies