-
It seems export default {
setup (props) {
const {
currentPage,
currentPageSize,
pageCount
} = useOffsetPagination({
total: props.locations.length,
page: 1,
pageSize: 15
})
}
} When |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'll answer my own question. So the secret is to wrap the export default {
setup (props) {
const placesLength = computed(() => props.location.length)
const {
currentPage,
currentPageSize,
pageCount
} = useOffsetPagination({
total: placesLength,
page: 1,
pageSize: 15
})
}
} |
Beta Was this translation helpful? Give feedback.
I'll answer my own question.
I've deep dived in the source code the expected type for
total
is aMaybeRef<number>
It seems
useOffsetPagination
total
option is not reactive.So the secret is to wrap the
length
as aRef
or aComputedRef