Skip to content

useOffsetPagination can't detect database changes? #2368

Answered by lbineau
komacha asked this question in Q&A
Discussion options

You must be logged in to vote

It would be useful to see the code about useOffsetPagination
I believe you run into the same issue that me (and you also use it like in the demo https://github.com/vueuse/vueuse/blob/main/packages/core/useOffsetPagination/demo.vue#L50)

My answer on a similar topic will probably help you.
TL;DR just wrap the number inside a Ref like:

const itemsLength = computed(() => props.items.length)
useOffsetPagination({ total: itemsLength })

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@komacha
Comment options

Answer selected by komacha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants