Reputation: 123
Please help. I have this code. I have a feeling that v-for caches (or wrongly work with it) my data array. Newly added objects (with "Add" button) are edited like the same. Try to add some rows and put some text or change a checkbox and you will see.
Upvotes: 0
Views: 35
Reputation: 1731
// Update this fn to:
addMessenger() {
this.data.profile.vsAppMessengers.push({...this.data.profile.messengerTemplate});
},
Issue was: the object is copied by reference. To read more: https://codeburst.io/explaining-value-vs-reference-in-javascript-647a975e12a0
Updated fiddle link: https://jsfiddle.net/shivampesitbng/6hoL0jts/2/
Upvotes: 2