0
点赞
收藏
分享

微信扫一扫

antd相关报错

伢赞 2022-04-13 阅读 91
react.js

1、Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.

问题:按照 React 的规范,所有的数组组件必须绑定 key。在 Table 中,dataSource 和 columns 里的数据值都需要指定 key 值。

解决:Table中加入rowKey属性

<Table
          columns={this.columns}
          dataSource={logArr.data}
          rowKey={record => record.id}//加入这行代码
          pagination={{
            total: logArr.total,
            current: filters.page,
            pageSize: filters.page_size,
            showSizeChanger: true,
            showQuickJumper: true,
            onChange: self.updatePageFilters,
            onShowSizeChange: self.updatePageFilters,
          }}
        />
举报

相关推荐

0 条评论