2015-07-09 11:41:36 +08:00
|
|
|
# 基本用法
|
|
|
|
|
|
|
|
- order: 0
|
|
|
|
|
2015-07-09 14:51:48 +08:00
|
|
|
简单的表格。
|
2015-07-09 11:41:36 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
var Table = antd.Table;
|
|
|
|
var columns = [{
|
|
|
|
title: '姓名',
|
|
|
|
dataIndex: 'name'
|
|
|
|
}, {
|
|
|
|
title: '年龄',
|
|
|
|
dataIndex: 'age'
|
2015-07-09 14:51:48 +08:00
|
|
|
}, {
|
|
|
|
title: '住址',
|
2015-07-09 20:29:26 +08:00
|
|
|
dataIndex: 'address',
|
|
|
|
render: function(text) {
|
|
|
|
return <a href="#">{text}</a>;
|
2015-07-09 14:51:48 +08:00
|
|
|
}
|
2015-07-09 11:41:36 +08:00
|
|
|
}];
|
|
|
|
var data = [{
|
|
|
|
name: '胡彦斌',
|
2015-07-09 14:51:48 +08:00
|
|
|
age: 32,
|
|
|
|
address: '西湖区湖底公园1号'
|
2015-07-09 11:41:36 +08:00
|
|
|
}, {
|
|
|
|
name: '胡彦祖',
|
2015-07-09 14:51:48 +08:00
|
|
|
age: 42,
|
|
|
|
address: '西湖区湖底公园1号'
|
2015-07-09 11:41:36 +08:00
|
|
|
}, {
|
|
|
|
name: '李大嘴',
|
2015-07-09 14:51:48 +08:00
|
|
|
age: 32,
|
|
|
|
address: '西湖区湖底公园1号'
|
2015-07-09 11:41:36 +08:00
|
|
|
}];
|
|
|
|
|
|
|
|
React.render(<Table columns={columns} data={data} />
|
|
|
|
, document.getElementById('components-table-demo-basic'));
|
|
|
|
````
|