You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like the form handling style using computed property setter, for its less verbosity.
But when I use it with multiple checkboxes bound to the same array, the property setter is never called and I got an error: "[vuex] Do not mutate vuex store state outside mutation handlers" if strict option is set to be true.
This is because v-model when bound to a checkbox array, directly mutates the array with push instead of replacing the array. You probably want to use a watcher instead.
Hi,
I like the form handling style using computed property setter, for its less verbosity.
But when I use it with multiple checkboxes bound to the same array, the property setter is never called and I got an error: "[vuex] Do not mutate vuex store state outside mutation handlers" if strict option is set to be true.
Here is an example:
https://jsfiddle.net/chrome_cgi/37q0h6xa/4/
This may be because Vue pushes the value directly into the model in its checkbox listener function.
I somehow got to work by patching Vue to call the setter with newly created array, but I'm not sure if this is an appropriate way.
Is this a bug or an intended behavior, and should I avoid using setter with an array typed v-model?
Thanks.
The text was updated successfully, but these errors were encountered: