最佳答案
Table
组件的 rowKey
属性接受一个 function
或一个 string
如果它是一个单行表:
rowKey - Row's unique key, could be a string or function that returns a string
string|Function(record):string
您应该始终提供一个函数,例如,如果dataSource
具有key
属性:record => record.key
<Table columns={columns} dataSource={dataSource} rowKey={record => record.key} />;
关于javascript - antd table : why record. 键在我设置rowkey时返回undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56896420/