【小白求问】关于vue中data更新

【小白求指教】
为什么我有时候在浏览器的vue-devtools插件里没有看到里面的data实时变动,但是console那个data,data的值确实改变了,而且发现vue-devtools插件里的该data会在后面1-2步操作后才变化,这是什么原因啊?应该要如何解决?

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);},

我发现新增了判断语句后就可以实时更新了,这又是为什么啊?

if (item.list.length) {...}


冉冉说
浏览 697回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Vue.js