AntDesign of React 之 rowkey 问题


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

const {onLoadProductListData} = this.props
    onLoadProductListData(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}}
                        />


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM