Skip to content

Commit ac586fd

Browse files
hyxingyuefeng
authored andcommitted
fix: 修改Flex和Table组件文档
1 parent 92b55f8 commit ac586fd

File tree

2 files changed

+49
-38
lines changed

2 files changed

+49
-38
lines changed

packages/core/src/Flex/README.md

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ Flex Flex布局
44

55
Flex 是 React Native CSS flex 布局的一个封装。
66

7-
![](https://user-images.githubusercontent.com/66067296/137708776-ad9d357f-9aad-4131-8bb1-408f4ae90a08.png)<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
8-
![](https://user-images.githubusercontent.com/66067296/137708793-79f69f8b-1d8d-4278-9aa9-6562ea6f1094.png)<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
9-
![](https://user-images.githubusercontent.com/66067296/137708799-435612a4-0139-411e-b7fa-b9f4c63be07f.png)<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
10-
117
### 基础示例
128

13-
```jsx
14-
import { Fragment } from 'react';
9+
```jsx mdx:preview
10+
import React,{ Fragment } from 'react';
1511
import { Flex, Button } from '@uiw/react-native';
1612

17-
function Demo() {
13+
const Demo = () => {
1814
return (
1915
<Fragment>
2016
<Flex>
@@ -31,41 +27,56 @@ function Demo() {
3127
</Fragment>
3228
);
3329
}
30+
31+
export default Demo
3432
```
3533

3634
### 对齐方式
3735

38-
```jsx
39-
import { Fragment } from 'react';
40-
import { Flex, Button } from '@uiw/react-native';
41-
42-
const Circle = (props: any) => {
43-
const size = props.size || 20;
44-
const style = {
45-
borderRadius: size / 2,
46-
backgroundColor: 'red',
47-
width: size,
48-
height: size,
49-
margin: 1,
50-
};
51-
return <View style={style} />;
52-
};
53-
54-
function Demo() {
36+
```jsx mdx:preview
37+
import React,{ Fragment } from 'react';
38+
import {Flex, Button, Spacing, Icon } from '@uiw/react-native';
39+
import {View, Text} from 'react-native';
40+
const Demo = () => {
5541
return (
5642
<Fragment>
5743
<Flex justify="start">
58-
<Circle /> <Circle /> <Circle /> <Circle /> <Circle />
44+
<Button>警告</Button>
45+
<Button>警告</Button>
46+
<Button>主要</Button>
47+
<Button>警告</Button>
5948
</Flex>
49+
<Spacing />
6050
<Flex justify="center">
61-
<Circle /> <Circle /> <Circle /> <Circle /> <Circle />
51+
<Button color="#fff">
52+
<Icon name="apple" size={17} />
53+
<Text> apple</Text>
54+
</Button>
55+
<Button color="#fff">
56+
<Icon name="menu-fold" size={17} />
57+
<Text> menu-fold</Text>
58+
</Button>
59+
<Button color="#ffc107">
60+
<Icon name="warning" size={17} />
61+
<Text> warning</Text>
62+
</Button>
63+
<Button type="danger">
64+
<Icon name="warning" fill="#fff" size={17} />
65+
<Text> warning</Text>
66+
</Button>
6267
</Flex>
68+
<Spacing />
6369
<Flex justify="end">
64-
<Circle /> <Circle /> <Circle /> <Circle /> <Circle />
70+
<Button>警告</Button>
71+
<Button>警告</Button>
72+
<Button>主要</Button>
73+
<Button>警告</Button>
6574
</Flex>
6675
</Fragment>
6776
);
6877
}
78+
export default Demo
79+
6980
```
7081

7182
### Props

packages/core/src/Table/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Table 表格
22
---
3-
4-
![](https://user-images.githubusercontent.com/57083007/146733861-7c491a0b-d44d-41d2-94f4-6e7db5271cb0.png)<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
5-
3+
一个非常好用的Table表格 😄
64
### 基础示例
75

8-
```jsx
9-
import { Table } from '@uiw/react-native';
6+
```jsx mdx:preview
7+
import React from 'react';
8+
import {Table, Button } from '@uiw/react-native';
9+
import {View} from 'react-native';
1010

11-
function Demo() {
11+
const Demo = () => {
1212
return (
1313
<Table
1414
columns={[
@@ -31,17 +31,15 @@ function Demo() {
3131
title: '备注',
3232
dataIndex: 'remark',
3333
ellipsis: true,
34-
style: { width: 100 },
34+
style: { width: 400 },
3535
},
3636
{
3737
title: '操作',
3838
dataIndex: 'id',
39-
style: { width: 90 },
39+
style: { width: 50 },
4040
render: () => {
4141
return (
42-
<TouchableHighlight onPress={() => { }}>
43-
<Text style={{ color: '#888' }}>查看</Text>
44-
</TouchableHighlight>
42+
<Button size="small">详情</Button>
4543
);
4644
},
4745
},
@@ -56,6 +54,8 @@ function Demo() {
5654
/>
5755
);
5856
}
57+
export default Demo
58+
5959
```
6060

6161
### props

0 commit comments

Comments
 (0)