Skip to content

Commit 28f1453

Browse files
committed
doc(Flex): update document.
1 parent 89f0371 commit 28f1453

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

packages/core/src/Flex/README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,27 @@ function Demo() {
6868

6969
### Flex
7070

71-
| 参数 | 说明 | 类型 | 默认值 |
72-
| --- | --- | --- | --- |
73-
| `direction` | 项目定位方向 | `row`, `column`, `row-reverse`, `column-reverse` | `row` |
74-
| `wrap` | 子元素的换行方式 | `wrap`, `nowrap`, `wrap-reverse`, `nowrap` |
75-
| `justify` | 子元素在主轴上的对齐方式 | `start`, `end`, `center`, `between`, `around` | `start` |
76-
| `align` | 子元素在交叉轴上的对齐方式 | `start`, `end`, `center`, `stretch`, `baseline` | `start` |
71+
```ts
72+
export interface FlexProps extends ViewProps {
73+
/**
74+
* 项目定位方向
75+
* `row`, `column`, `row-reverse`, `column-reverse`
76+
* @default row
77+
*/
78+
direction?: FlexStyle['flexDirection'];
79+
/** 子元素在主轴上的对齐方式 */
80+
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
81+
/** 子元素在交叉轴上的对齐方式 */
82+
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
83+
/** 子元素的换行方式 */
84+
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
85+
}
86+
```
7787

7888
### Flex.Item
7989

80-
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
90+
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
91+
92+
```ts
93+
export interface FlexItemProps extends ViewProps {}
94+
```

packages/core/src/Flex/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ import { View, ViewProps, FlexStyle } from 'react-native';
33
import FlexItem from './FlexItem';
44

55
export interface FlexProps extends ViewProps {
6+
/**
7+
* 项目定位方向
8+
* `row`, `column`, `row-reverse`, `column-reverse`
9+
* @default row
10+
*/
611
direction?: FlexStyle['flexDirection'];
12+
/** 子元素在主轴上的对齐方式 */
713
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
14+
/** 子元素在交叉轴上的对齐方式 */
815
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
16+
/** 子元素的换行方式 */
917
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
1018
}
1119

0 commit comments

Comments
 (0)