[Xiaobai asks for advice]
Why do I sometimes not see the real-time change of data in the vue-devtools plug-in of the browser, but the value of the data,data of console does change, and it is found that the data in the vue-devtools plug-in will not change until the next 1-2 steps? How should it be solved?
addProp() {
this.tablePropList = [];
this.tableProp = [];
this.selectedPropName = [];
// -> [[1,2,...],[a,b,...],...]
this.selectedPropList.forEach(item => {
if (item.list.length) { //
this.tableProp.push(item.list);
this.selectedPropName.push(item.name);
}
});
//
let trProp = this.sortArr(this.tableProp);
trProp.forEach(item => {
this.tablePropList.push({
prop: item instanceof Array ? item : [item],
goodsSalePrice: "",
goodsStock: "",
stockWarning: ""
});
});
// console.log(this.tablePropList);
},
I found that after adding a judgment statement, I can update it in real time. Why?
if (item.list.length) {...}