[Vuejs]-Vue – Checkbox all to handle global editing of selects – Object sticking

1πŸ‘

First, you missed :key property in v-for, so all yours rows are treated as same – change this line like this: <tr v-for="(file, fileKey) in files" :key="file">

Second, in you loop you are assigning to all rows the same product, and this is leads to behaviour you want to avoid:

    const product = Object.assign({}, this.order['products'][this.getSelectedFile]);
...
    this.selectedFiles.forEach(fileIndex => {
      order['products'][fileIndex] = product || {};
    });

Leave a comment