el-table input输入无效

2022-06-22  本文已影响0人  上海_前端_求内推

方法一:forceUpdate

<el-input :rows="1" @input="sgradeInp(scope.$index)" v-model="scope.row.score_grade" placeholder="请输入"></el-input>
sgradeInp(e) {
   this.$forceUpdate(); //强制更新视图数据
},

方法二:更新行

<el-input :rows="1" @input="sgradeInp(scope.$index)" v-model="scope.row.score_grade" placeholder="请输入"></el-input>

  sgradeInp(e) {
    //e当前行
    //form  tab数据源
  let list = this.form.checkItemList[e]
  this.$set(this.form.checkItemList, e, list);
  //$set参数说明
  //this.form.checkItemList:要修改的数据
  //e:key
  //list:修改的值
},
   
上一篇 下一篇

猜你喜欢

热点阅读