When you add a new table line, you change the original new line?

 submitAddBook (data) {
    this.addBookOnoff = false
    this.tableData.push(data)
}

The figure above

clipboard.png
is the last line to be added. Why has the previous line been changed as well?

Sep.07,2021

you can see if it is the same object referenced


print the this.tableData to see if it is the data object added by default.


have you solved this problem? ask for sharing


this problem occurs in vue, to a large extent, it is the problem of : key .

In the case of

array, it is possible that you are using the wrong splice, but you are using push, so the problem is on key.

Menu