mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
parent
f862655df5
commit
f4b10a9e7c
@ -58,6 +58,7 @@ export default class Table extends React.Component {
|
|||||||
indentSize: 20,
|
indentSize: 20,
|
||||||
onChange: noop,
|
onChange: noop,
|
||||||
locale: {},
|
locale: {},
|
||||||
|
rowKey: 'key',
|
||||||
}
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
@ -486,10 +487,11 @@ export default class Table extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRecordKey(record, index) {
|
getRecordKey(record, index) {
|
||||||
if (this.props.rowKey) {
|
const { rowKey } = this.props;
|
||||||
return this.props.rowKey(record, index);
|
if (typeof rowKey === 'function') {
|
||||||
|
return rowKey(record, index);
|
||||||
}
|
}
|
||||||
return record.key || index;
|
return record[rowKey] || index;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderRowSelection() {
|
renderRowSelection() {
|
||||||
|
Loading…
Reference in New Issue
Block a user