Skip to content

Component not updating (even though data is updated in devtools) when using external class to change data in Pinia Store [Nuxt 2/Bridge] #2583

Discussion options

You must be logged in to vote

I had a sudden epiphany. Since Vue 2's composition API still relies on Vue 2's reactivity system instead of Vue 3's, it seemed like I may have been struggling with those same limitations.

When I replaced the parts of my code that updated, added, or deleted data from the external driver class with set/del from Vue 2, it magically started working as intended. The part that I didn't realize before was that Vue 2's composition API is not creating a reactive copy of the data you give it but instead converting the data you provide it into reactive data. Therefore, you need to manipulate it the same way you manipulate reactive data in Vue 2 (with set/del).

So, a lesson learned here: you still ne…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by millansingh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue 2.x Specific to Vue 2 usage ⛰ pkg:nuxt Related to @pinia/nuxt
1 participant
Converted from issue

This discussion was converted from issue #2582 on February 19, 2024 07:14.