0👍
I found the answer in the documentation:
Note that objects and arrays in JavaScript are passed by reference, so if the prop is an array or object, mutating the object or array itself inside the child component will affect parent state.
The solution was to deep clone the prop value (I used lodash) into a new variable (and then $emit
it as mentioned in the question)
- [Vuejs]-Using V-for in checkboxes in vue
- [Vuejs]-Having a button on a child component run a function on the parent
Source:stackexchange.com