提交 9e82dee2 编写于 作者: A afc163

Add rowKey tip in document

上级 eb828f0e
......@@ -101,3 +101,16 @@ var dataSource = new Table.DataSource({
| resolve | 获得数据的解析函数,接收参数为远程数据返回的 result | Function | | |
| getPagination | 和后台接口返回的分页数据进行适配的函数,返回值会传给表格中的分页器 | Function | | |
| getParams | 和后台接口接收的参数进行适配,返回值会作为请求的参数发送 | Function | | 无 |
## 注意
按照 React 的规范,所有的组件数组必须绑定 key。在 Table 中,默认将每列数据的 `key` 属性作为唯一的标识。
如果你的数据没有这个属性,你需要使用 `rowKey` 来指定数据列的主键。
```jsx
const rowKey = function(record) {
return record.uid; // 比如你的数据主键是 uid
};
return <Table rowKey={rowKey} />;
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册