Comparing version 2.1.1 to 2.2.0
@@ -70,3 +70,3 @@ 'use strict'; | ||
'td', | ||
null, | ||
{ key: col.key }, | ||
text | ||
@@ -105,3 +105,3 @@ )); | ||
var col = columns[i]; | ||
rst.push(React.createElement(TableColumn, { title: col.title, dataIndex: col.dataIndex, width: col.width })); | ||
rst.push(React.createElement(TableColumn, { title: col.title, dataIndex: col.dataIndex, width: col.width, key: col.key })); | ||
} | ||
@@ -118,5 +118,7 @@ return rst; | ||
var keyFn = this.props.rowKey; | ||
for (var i = 0; i < data.length; i++) { | ||
var record = data[i]; | ||
rst.push(React.createElement(TableRow, { record: record, index: i, columns: columns })); | ||
var key = keyFn ? keyFn(record, i) : undefined; | ||
rst.push(React.createElement(TableRow, { record: record, index: i, columns: columns, key: key })); | ||
} | ||
@@ -123,0 +125,0 @@ return rst; |
{ | ||
"name": "rc-table", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "table ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -41,3 +41,3 @@ # rc-table | ||
online example: http://react-component.github.io/table/build/examples/ | ||
online example: http://react-component.github.io/table/examples/ | ||
@@ -69,5 +69,11 @@ ## Usage | ||
#### columns | ||
#### rowKey | ||
`Function(recode):string` | ||
* get key value of each row from each row record data | ||
#### columns | ||
* The columns config of table | ||
* key : key of this column | ||
* title : The title of column | ||
@@ -94,2 +100,2 @@ * dataIndex : display the data field | ||
rc-table is released under the MIT license. | ||
rc-table is released under the MIT license. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8809
137
99
0
0