Hello, trying to make a copy in the list. enter image description here

The buttons pass the correct index, the index I pass through this.$root.$emit('copy', this.index)
Parents picks up and executes copy and made increment & decrement by the same principle

 methods: { copy (index) { this.list.push(this.list[index]) }, increment (index) { this.list[index].score >= 10 ? false : this.list[index].score++ }, decrement (index) { this.list[index].score <= 1 ? false : this.list[index].score-- } }, 

But of some hell all the values ​​are the same.

    1 answer 1

    It is not strong in the framework that you use, but according to the code it looks like you are not copying objects, but copying links to objects.

    I think this code will help:

     copy (index) { this.list.push(Object.assign({}, this.list[index])); }, 

    Just keep in mind that Object.assign is ECMAScript 2015, if you are without bebel, then use an analog from your library.

    • You are right, I got used to the {... object} structure in the reactor, and here the ready assembler did not have it, I didn’t want to bet, but I had little thought to go ... I knew that this was the problem, but until the last time I believed , what's wrong. - DimenSi