Skip to content

Commit

Permalink
doc(Flex): update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 17, 2021
1 parent 89f0371 commit 28f1453
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
28 changes: 21 additions & 7 deletions packages/core/src/Flex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,27 @@ function Demo() {

### Flex

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| `direction` | 项目定位方向 | `row`, `column`, `row-reverse`, `column-reverse` | `row` |
| `wrap` | 子元素的换行方式 | `wrap`, `nowrap`, `wrap-reverse`, `nowrap` |
| `justify` | 子元素在主轴上的对齐方式 | `start`, `end`, `center`, `between`, `around` | `start` |
| `align` | 子元素在交叉轴上的对齐方式 | `start`, `end`, `center`, `stretch`, `baseline` | `start` |
```ts
export interface FlexProps extends ViewProps {
/**
* 项目定位方向
* `row`, `column`, `row-reverse`, `column-reverse`
* @default row
*/
direction?: FlexStyle['flexDirection'];
/** 子元素在主轴上的对齐方式 */
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
/** 子元素在交叉轴上的对齐方式 */
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
/** 子元素的换行方式 */
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
}
```

### Flex.Item

继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。

```ts
export interface FlexItemProps extends ViewProps {}
```
8 changes: 8 additions & 0 deletions packages/core/src/Flex/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ import { View, ViewProps, FlexStyle } from 'react-native';
import FlexItem from './FlexItem';

export interface FlexProps extends ViewProps {
/**
* 项目定位方向
* `row`, `column`, `row-reverse`, `column-reverse`
* @default row
*/
direction?: FlexStyle['flexDirection'];
/** 子元素在主轴上的对齐方式 */
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
/** 子元素在交叉轴上的对齐方式 */
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
/** 子元素的换行方式 */
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
}

Expand Down

0 comments on commit 28f1453

Please sign in to comment.