Skip to content

Commit 4155f09

Browse files
authored
Update and rename index.md to README.md
1 parent aafefe4 commit 4155f09

File tree

2 files changed

+62
-52
lines changed

2 files changed

+62
-52
lines changed

components/Table/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Table 表格
2+
---
3+
4+
## 基础示例
5+
6+
```jsx
7+
import { Table } from '@uiw/react-native';
8+
9+
function Demo() {
10+
return (
11+
<Table
12+
columns={[
13+
{
14+
title: '类型',
15+
dataIndex: 'reportType',
16+
ellipsis: true,
17+
},
18+
{
19+
title: '备注',
20+
dataIndex: 'remark',
21+
ellipsis: true,
22+
},
23+
{
24+
title: '操作',
25+
dataIndex: 'id',
26+
render: record => {
27+
return (
28+
<TouchableHighlight onPress={()=>{ }}>
29+
<Text style={{color: '#888'}}>查看</Text>
30+
</TouchableHighlight>
31+
);
32+
},
33+
},
34+
]}
35+
data={[
36+
{id: '1', reportType: '❤️爱永恒', remark: 'ff爱zz,三生三世用相随'},
37+
{id: '2', reportType: '❤️爱永恒', remark: 'ff爱zz,三生三世用相随'},
38+
{id: '3', reportType: '❤️爱永恒', remark: 'ff爱zz,三生三世用相随'},
39+
{id: '4', reportType: '❤️爱永恒', remark: 'ff爱zz,三生三世用相随'},
40+
]}
41+
rowKey="id"
42+
/>
43+
);
44+
}
45+
```
46+
47+
### props
48+
49+
| 参数 | 说明 | 类型 | 默认值 |
50+
| -------------------- | ------------ | ------- | ------- |
51+
| `columns` | 表格列的配置描述,具体项见下表 | ColumnsType[] | - |
52+
| `data` | 数据数组 | object[] | - |
53+
| `rowKey` | 表格行 key 的取值,可以是字符串或一个函数 | string | function(record): string | key |
54+
55+
### Column
56+
57+
| 参数 | 说明 | 类型 | 默认值 |
58+
| -------------------- | ------------ | ------- | ------- |
59+
| `dataIndex` | 列数据在数据项中对应的路径,支持通过数组查询嵌套路径 | string | string[] | - |
60+
| `ellipsis` | 超过宽度将自动省略 | - |
61+
| `title` | 列头显示文字 | string | - |
62+
| `render` | 生成复杂数据的渲染函数,参数为当前行数据 | function(record) {} | - |

components/Table/index.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)