Issue of vue setting value

I'm trying to set up the assignment of the data to the object, but when you try to do it with a v-model and an external function for some reason, the fields are updated in all the child elements instead of one update. here's the code in Sandbox and Sanbox with v-model

Upvotes: 2

Views: 54

Answers (1)

Lawrence Cherone
Lawrence Cherone

Reputation: 46610

In the v-model one,

change

this.template_['default_' + this.iterable++] = Object.assign(this.template_default);

to

this.$set(this.template_, 'default_' + this.iterable++, Object.assign({}, this.template_default));

Upvotes: 1

Related Questions