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,
}}
/>
2、antd select palceholder不显示
解决:initialValue设置为undefined