wants to handle some business logic in computed, but ESlint prompts that variables in data cannot be reassigned in computed; is there a better way for
to handle it? Except for putting it in watch
computed: {
userData() {
const userData = JSON.parse(JSON.stringify(this.data));
let resultArr = [];
Object.entries(userData).forEach(([key, value]) => {
// eslint-disable-next-line
userData[key].isFull = this.checkListItem(userData[key]);
userData[key].showName = this.nameFormat(userData[key]);
...
resultArr.push(userData[key]);
});
//
_.forEach(resultArr, (item, index) => {
_.forEach(this.defaultPerson, (it, id) => {
if (it === item.ads && !item.isFull) {
// eslint-disable-next-line
this.isSelected.splice(index, 1, false);
// eslint-disable-next-line
this.addPeopleArr.splice(index, 1, false);
}
});
});
return resultArr;
},
},