项目场景:

使用Element中的el-table生成表格时,控制台报错:“Error: row is required when get row identity”

错误信息如下:

原因分析:

  1. 未添加row-key属性
  2. tableList类型不为[]
  3. 当调用getRowIdentity函数,但是参数为空的时候会触发,查看用了哪些el-table自带的方法
    let row = this.deviceList.filter(item => item.deviceId == this.form.ledDeviceId)[0];
    if (row) {
    	this.$refs.equipmentTable.toggleRowSelection(row);
    }
    

Logo

一站式 AI 云服务平台

更多推荐