AntDesign of React 之 rowkey 问题

属性冲突会报错: 用父级的id拼接到子级的id上

const {onLoadProductListData} = this.props
    onl oadProductListData(1,(res)=>{
      res.payload.forEach(event=>{
        event.eventAttribute.forEach(attr=>{
          attr.id =  `${event.id}_${attr.id}`
        })
      })
      console.log(res.payload)
      this.setState({
        eventList: res.payload
      })



<Table
                          rowKey='id'
                          pagination={false}
                          columns={columns}
                          rowSelection={rowSelection}
                          dataSource={this.state.eventList}
                          childrenColumnName ="eventAttribute"
                          indentSize={20}
                          scroll={{y:this.state.tableHeight, x:1300}}
                        />
上一篇:antdesign select可输入可选择


下一篇:SpringBoot+Vue+AntDesign搭建的前后端分离后台管理系统