Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot update usePagination totalItems #3120

Open
2 of 3 tasks
giorgiopogliani opened this issue Apr 23, 2024 · 0 comments
Open
2 of 3 tasks

[Bug]: Cannot update usePagination totalItems #3120

giorgiopogliani opened this issue Apr 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@giorgiopogliani
Copy link

Describe the Bug

I am passing props to this component https://docs.storefrontui.io/v2/vue/blocks/pagination

const props = defineProps<{ totalItems: number; currentPage:number; pageSize: number }>();

The component doesn't update the totalItems of course, because vue doesn't always rerender component. The composable doesn't have a method to update it tho, and I cannot pass computed ref as arguments of the composables. There is only setPage but is not enough.

How am I supposed to use this composable?

Expected behavior

A method or something to update the totalItems or be able to pass computed refs, so that the composable can react the props changing.

Steps to reproduce

  • Add the Pagination component to a page
  • pass the props to the component
  • update the totalItems, in real world this would mean fetch new products or something
  • the pagination buttons are not updating

SFUI version

@storefront-ui/vue@2.6.2

Framework

Nuxt 3

Node version

21

Browser

Chrome

OS

Mac OS

Relevant log output

No response

Able to fix / change the documentation?

  • Yes
  • No

Code of Conduct

  • I agree to follow this project's Code of Conduct
@giorgiopogliani giorgiopogliani added the bug Something isn't working label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant