瀏覽代碼

StandardTable need a "rowKey" prop (#1175)

* StandardTable.rowKey

* eslint no-unneeded-ternary
neoscript99 7 年之前
父節點
當前提交
a982dedfcc
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/components/StandardTable/index.js

+ 2 - 2
src/components/StandardTable/index.js

@@ -63,7 +63,7 @@ class StandardTable extends PureComponent {
 
   render() {
     const { selectedRowKeys, needTotalList } = this.state;
-    const { data: { list, pagination }, loading, columns } = this.props;
+    const { data: { list, pagination }, loading, columns, rowKey } = this.props;
 
     const paginationProps = {
       showSizeChanger: true,
@@ -105,7 +105,7 @@ class StandardTable extends PureComponent {
         </div>
         <Table
           loading={loading}
-          rowKey={record => record.key}
+          rowKey={rowKey || 'key'}
           rowSelection={rowSelection}
           dataSource={list}
           columns={columns}