Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

如题,不知道怎么 我调用组件的时候就报出这个错误了

<slide-out
      dock="right"
      :visible="slideOutAttr.visiblity"
      :size="slideOutAttr.size"
      :z-index="10"
      @close="onClose"
    >
      <div slot="header" slot-scope="title">{{ title }}</div>
      <AssignAE :code-list="codeList" :visible="slideOutAttr.visiblity" :on-close="onClose" :save-callback="saveCallBack" :assign-id="slideOutAttr.selectedAssignId" />
    </slide-out>
// 信息-添加行
      addNewDetail () {
        const that = this
        that.generateId();
        that.generateSerialNumber();
        that.assignInfoList.orderAssignInfo.push({
          detailId: that.tempId,
          serialNumber: that.serialNo
        })
        console.log(that.tempId)
        console.log(that.serialNo)
        // console.log(that.assignInfoList)
      },
      // 信息-删除行
      deleteDetail (row) {
        const that = this
        that.assignInfoList.splice(row.index, 1)
        for (let i = 0; i < that.assignInfoList.length; i++) {
          that.assignInfoList[i].serialNumber = i + 1
          that.serialNo = i + 1
        }
      },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

建议查一下空值,that.assignInfoList.orderAssignInfo 空值的情况下是 undefined,就会报这个错误。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...