Initialize an array in vue watch. The view cannot respond after the properties in the array object are changed.

jsfiddle

initialize the newVal array with map so that it has one more attribute b than the value array, but there is no response on the view when the b attribute is changed. You can change the following code in the watch method to take effect

const arr = newVal.map(item => {
    item.b = true;
    return item;
})
this.newVal = JSON.parse(JSON.stringify(arr))

but didn"t array.prototype.map generate a new array? why didn"t the b attribute add watch

Mar.31,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35317-2bf8b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35317-2bf8b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?