Skip to content

Commit ddbcb8f

Browse files
committed
doc(Grid):修改Grid api文档
1 parent 0ef5449 commit ddbcb8f

File tree

1 file changed

+17
-40
lines changed

1 file changed

+17
-40
lines changed

packages/core/src/Grid/README.md

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -88,44 +88,21 @@ function Demo() {
8888
export default Demo
8989

9090
```
91-
9291
### Props
93-
94-
95-
```ts
96-
interface ItemData {
97-
icon?: React.ReactNode;
98-
text?: React.ReactNode;
99-
}
100-
101-
```
102-
103-
```ts
104-
export interface GridProps extends ViewProps {
105-
/**
106-
* 传入的菜单数据,`icon` 可以是 `ReactNode` 或者 `uri`
107-
* @default []
108-
*/
109-
data?: ItemData[];
110-
/**
111-
* 列数
112-
* @default 4
113-
*/
114-
columns?: number;
115-
/**
116-
* 是否有间隔线
117-
* @default true
118-
*/
119-
hasLine?: boolean;
120-
/** 单元格样式 */
121-
itemStyle?: StyleProp<ViewStyle>;
122-
/** 单元格文本样式 */
123-
textStyle?: StyleProp<TextStyle & ViewStyle>;
124-
/** 图片样式,可设置图片/图标尺寸 */
125-
iconStyle?: StyleProp<ImageStyle & TextStyle & ViewStyle>;
126-
/** 自定义单元格 */
127-
renderItem?: (data: ItemData, index: number, row: number) => React.ReactNode;
128-
/** 点击宫格回调函数 */
129-
onPress?: (data: ItemData, index: number, row: number, event: GestureResponderEvent) => void;
130-
}
131-
```
92+
| 参数 | 说明 | 类型 | 默认值 |
93+
|------|------|-----|------|
94+
| data | 菜单数据,`icon` 可以是 `ReactNode` 或者 `uri` | `ItemData[]` | - |
95+
| columns | 列数 | `number` | 4 |
96+
| hasLine | 是否有间隔线 | `boolean` | true |
97+
| itemStyle | 单元格样式 | `StyleProp<ViewStyle>` | - |
98+
| textStyle | 单元格文本样式 | `StyleProp<TextStyle & ViewStyle>` | - |
99+
| iconStyle | 图片样式,可设置图片/图标尺寸 | `StyleProp<ImageStyle & TextStyle & ViewStyle>` | - |
100+
| renderItem | 自定义单元格 | `(data: ItemData, index: number, row: number) => React.ReactNode` | - |
101+
| onPress | 点击宫格回调函数 | `(data: ItemData, index: number, row: number, event: GestureResponderEvent) => void` | - |
102+
103+
104+
### ItemData
105+
| 参数 | 说明 | 类型 | 默认值 |
106+
|------|------|-----|------|
107+
| text | 显示文字 | `React.ReactNode` | - |
108+
| icon | 图标 | `React.ReactNode` | - |

0 commit comments

Comments
 (0)