Adding properties to state is not reactive with vue 3 #1131
Unanswered
realityfilter
asked this question in
Help and Questions
Replies: 1 comment
-
Would love to see an answer to this! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Reproduction
Take the following store. The triggering of the action login does not change the state.
No mutation is recorded in the dev tools. If you uncomment the line in the state function everything works as expected.
Steps to reproduce the behavior
Use store and trigger login action. The subscription is not reactive.
Expected behavior
"If you are using Vue 2, the data you create in state follows the same rules as the data in a Vue instance, ie the state object must be plain and you need to call Vue.set() when adding new properties to it. See also: Vue#data. "
When using vue3 adding new state properties should work out of the box accordingly.
Actual behavior
Adding new properties to the state is not reactive.
Beta Was this translation helpful? Give feedback.
All reactions