el-table中input框不可修改的bug

this.ThreePartyInfo.tzj2146AbapResDtoList.forEach((item, index) => {
              item.gcname =
                this.ThreePartyInfo.tzj2142AbapResDtoList[index].gcname;
              item.gjhjl = item.hjl;
              this.$set(item, "sddw", item.sdpcdw);
              item.gjpcl = item.pcl;
              item.gjnote = item.note;
            });

这样拿值,没有用$set的可能会出现在input框不可更改的情况,要都换成$set

this.ThreePartyInfo.tzj2146AbapResDtoList.forEach((item, index) => {
              this.$set(item,'gcname',this.ThreePartyInfo.tzj2142AbapResDtoList[index].gcname)
              this.$set(item,'gjhjl',item.hjl)
              this.$set(item, "sddw", item.sdpcdw);
              this.$set(item,'gjpcl',item.pcl)
              this.$set(item,'gjnote',item.note)
            });

 后面会头再看,vue2声明变量时,需要写明确,比如

    data(){
      return {
        form: {
          key :''
        }
      }
    },

这样直接写 this.form.key = 'value'  就能将key值赋值

posted @ 2021-11-26 15:16  好吃么  阅读(904)  评论(0)    收藏  举报