Skip to content

Commit 0c14bdf

Browse files
committed
doc(Empty/Flex/Grid): update document.
1 parent 28f1453 commit 0c14bdf

File tree

6 files changed

+97
-26
lines changed

6 files changed

+97
-26
lines changed

packages/core/src/Empty/README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,27 @@ class Demo extends Component {
129129

130130
## Props
131131

132-
| 参数 | 说明 | 类型 | 默认值 |
133-
|------|------|-----|------|
134-
| `label` | 设置提示文本 | String | `暂无数据` |
135-
| `children` | 不光提示文本,还有更多内容,`label` 将不起作用 | ReactNode | - |
136-
| `labelStyle` | 设置提示文本样式 | TextProps['style'] | - |
137-
| `size` | 图标大小 | Number | `64` |
138-
| `xml` | 传递 SVG xml 字符串,自定义图标,设为 `null` 将不展示图标。 | String | - |
132+
```ts
133+
export interface EmptyProps extends FlexProps {
134+
/**
135+
* 设置提示文本
136+
*/
137+
label?: string;
138+
/**
139+
* 设置提示音样式
140+
*/
141+
labelStyle?: TextProps['style'];
142+
/**
143+
* 设置 图标尺寸
144+
*/
145+
size?: number;
146+
/**
147+
* 传递 SVG xml 字符串,自定义图标,设为 `null` 将不展示图标。
148+
*/
149+
xml?: string;
150+
/**
151+
* 不光提示文本,还有更多内容,`label` 将不起作用
152+
*/
153+
children?: React.ReactNode;
154+
}
155+
```

packages/core/src/Empty/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const iconStr = `
1717

1818
export interface EmptyProps extends FlexProps {
1919
/**
20-
* 设置提示语
20+
* 设置提示文本
2121
*/
2222
label?: string;
2323
/**
@@ -29,11 +29,11 @@ export interface EmptyProps extends FlexProps {
2929
*/
3030
size?: number;
3131
/**
32-
* 替换默认的图标 这里是 SVG string
32+
* 传递 SVG xml 字符串,自定义图标,设为 `null` 将不展示图标。
3333
*/
3434
xml?: string;
3535
/**
36-
* 空提示更多内容
36+
* 不光提示文本,还有更多内容,`label` 将不起作用
3737
*/
3838
children?: React.ReactNode;
3939
}

packages/core/src/Flex/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,20 @@ export interface FlexProps extends ViewProps {
7676
* @default row
7777
*/
7878
direction?: FlexStyle['flexDirection'];
79-
/** 子元素在主轴上的对齐方式 */
79+
/**
80+
* 子元素在主轴上的对齐方式
81+
* @default start
82+
*/
8083
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
81-
/** 子元素在交叉轴上的对齐方式 */
84+
/**
85+
* 子元素在交叉轴上的对齐方式
86+
* @default start
87+
*/
8288
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
83-
/** 子元素的换行方式 */
89+
/**
90+
* 子元素的换行方式
91+
* @default nowrap
92+
*/
8493
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
8594
}
8695
```

packages/core/src/Flex/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@ export interface FlexProps extends ViewProps {
99
* @default row
1010
*/
1111
direction?: FlexStyle['flexDirection'];
12-
/** 子元素在主轴上的对齐方式 */
12+
/**
13+
* 子元素在主轴上的对齐方式
14+
* @default start
15+
*/
1316
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
14-
/** 子元素在交叉轴上的对齐方式 */
17+
/**
18+
* 子元素在交叉轴上的对齐方式
19+
* @default start
20+
*/
1521
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
16-
/** 子元素的换行方式 */
22+
/**
23+
* 子元素的换行方式
24+
* @default nowrap
25+
*/
1726
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
1827
}
1928

packages/core/src/Grid/README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,32 @@ function Demo() {
5959

6060
## Props
6161

62-
| 参数 | 说明 | 类型 | 默认值 |
63-
|------|------|-----|------|
64-
| `data` | 传入的菜单数据,`icon` 可以是 `ReactNode` 或者 `uri` | Array<{icon?: React.ReactNode; text?: React.ReactNode;}> | `[]` |
65-
| `columns` | 列数 | Number | `4` |
66-
| `hasLine` | 是否有间隔线 | boolean | `true` |
67-
| `itemStyle` | 单元格样式 | ViewStyle | - |
68-
| `iconStyle` | 图片样式,可设置图片/图标尺寸 | ImageStyle & TextStyle & ViewStyle | - |
69-
| `textStyle` | 单元格文本样式 | TextStyle & ViewStyle | - |
70-
| `renderItem` | 自定义单元格 | (data, index, rowNum): void | - |
71-
| `onPress` | 点击宫格回调函数 | (data, index, rowNum): void | - |
62+
```ts
63+
export interface GridProps extends ViewProps {
64+
/**
65+
* 传入的菜单数据,`icon` 可以是 `ReactNode` 或者 `uri`
66+
* @default []
67+
*/
68+
data?: ItemData[];
69+
/**
70+
* 列数
71+
* @default 4
72+
*/
73+
columns?: number;
74+
/**
75+
* 是否有间隔线
76+
* @default true
77+
*/
78+
hasLine?: boolean;
79+
/** 单元格样式 */
80+
itemStyle?: StyleProp<ViewStyle>;
81+
/** 单元格文本样式 */
82+
textStyle?: StyleProp<TextStyle & ViewStyle>;
83+
/** 图片样式,可设置图片/图标尺寸 */
84+
iconStyle?: StyleProp<ImageStyle & TextStyle & ViewStyle>;
85+
/** 自定义单元格 */
86+
renderItem?: (data: ItemData, index: number, row: number) => React.ReactNode;
87+
/** 点击宫格回调函数 */
88+
onPress?: (data: ItemData, index: number, row: number, event: GestureResponderEvent) => void;
89+
}
90+
```

packages/core/src/Grid/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,30 @@ interface ItemData {
4444
}
4545

4646
export interface GridProps extends ViewProps {
47+
/**
48+
* 传入的菜单数据,`icon` 可以是 `ReactNode` 或者 `uri`
49+
* @default []
50+
*/
4751
data?: ItemData[];
52+
/**
53+
* 列数
54+
* @default 4
55+
*/
4856
columns?: number;
57+
/**
58+
* 是否有间隔线
59+
* @default true
60+
*/
4961
hasLine?: boolean;
62+
/** 单元格样式 */
5063
itemStyle?: StyleProp<ViewStyle>;
64+
/** 单元格文本样式 */
5165
textStyle?: StyleProp<TextStyle & ViewStyle>;
66+
/** 图片样式,可设置图片/图标尺寸 */
5267
iconStyle?: StyleProp<ImageStyle & TextStyle & ViewStyle>;
68+
/** 自定义单元格 */
5369
renderItem?: (data: ItemData, index: number, row: number) => React.ReactNode;
70+
/** 点击宫格回调函数 */
5471
onPress?: (data: ItemData, index: number, row: number, event: GestureResponderEvent) => void;
5572
}
5673

0 commit comments

Comments
 (0)