Actions -> Usage with the Options API -> with Setup() example on the pinia page doesn't work #1514
-
Hi, i have a problem with state outside of the pinia store. I can change the value of a variable inside the store but it is not updated outside of the store.
In my vue component, count is undefined and does not get updated. I use nuxt3. Would be really helpful to understand why the example is not working. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Don't mix setup and options API in components, it's not really supported. |
Beta Was this translation helpful? Give feedback.
Don't mix setup and options API in components, it's not really supported.
In your case, use
mapStores()
: https://pinia.vuejs.org/cookbook/options-api.html#usage-without-setup