Skip to content

Commit de0a4d4

Browse files
committed
Merge branch 'dev' of https://github.com/uiwjs/react-native-uiw into dev
2 parents 65402e4 + a986d9e commit de0a4d4

File tree

22 files changed

+528
-48
lines changed

22 files changed

+528
-48
lines changed

example/base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@example/base",
3-
"version": "3.0.7",
3+
"version": "3.0.8",
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",
@@ -10,7 +10,7 @@
1010
"lint": "eslint ."
1111
},
1212
"dependencies": {
13-
"@uiw/react-native": "3.0.7",
13+
"@uiw/react-native": "3.0.8",
1414
"react": "18.0.0",
1515
"react-native": "0.69.7",
1616
"react-native-svg": "12.1.1"

example/examples/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "examples",
3-
"version": "3.0.7",
3+
"version": "3.0.8",
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",
@@ -13,7 +13,7 @@
1313
"@react-native-community/masked-view": "~0.1.11",
1414
"@react-navigation/native": "~6.0.11",
1515
"@react-navigation/stack": "~6.2.2",
16-
"@uiw/react-native": "3.0.7",
16+
"@uiw/react-native": "3.0.8",
1717
"react": "18.0.0",
1818
"react-native": "0.69.7",
1919
"react-native-gesture-handler": "~2.5.0",

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "3.0.7",
2+
"version": "3.0.8",
33
"packages": ["example/*", "packages/*", "website"],
44
"npmClient": "yarn",
55
"npmClientArgs": ["--production", "--no-optional"],

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uiw/react-native",
3-
"version": "3.0.7",
3+
"version": "3.0.8",
44
"description": "UIW for React Native",
55
"homepage": "https://uiwjs.github.io/react-native-uiw/",
66
"main": "lib/index.js",

packages/core/src/Avatar/README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA2CAMAAAC7m5rvA
1515

1616
function Demo() {
1717
return (
18-
<View style={{ flexDirection: 'row' }}>
18+
<View style={{ flexDirection: 'row',justifyContent:'space-around' }}>
1919
<Avatar src="https://avatars.githubusercontent.com/u/24369183?v=4" />
2020
<Avatar src={uri} />
2121
</View>
@@ -26,6 +26,72 @@ export default Demo
2626

2727
```
2828

29+
### 头像尺寸
30+
31+
```jsx mdx:preview
32+
import React from 'react';
33+
import { View } from 'react-native';
34+
import { Avatar } from '@uiw/react-native';
35+
36+
function Demo() {
37+
return (
38+
<View style={{ flexDirection: 'row',justifyContent:'space-around' }}>
39+
<Avatar size={20} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
40+
<Avatar size={30} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
41+
<Avatar size={40} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
42+
<Avatar size={50} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
43+
</View>
44+
);
45+
}
46+
47+
export default Demo
48+
49+
```
50+
51+
### 设置头像圆角
52+
53+
```jsx mdx:preview
54+
import React from 'react';
55+
import { View } from 'react-native';
56+
import { Avatar } from '@uiw/react-native';
57+
58+
function Demo() {
59+
return (
60+
<View style={{ flexDirection: 'row',justifyContent:'space-around' }}>
61+
<Avatar rounded={0} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
62+
<Avatar rounded={5} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
63+
<Avatar rounded={10} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
64+
<Avatar rounded={20} src="https://avatars.githubusercontent.com/u/24369183?v=4" />
65+
</View>
66+
);
67+
}
68+
69+
export default Demo
70+
71+
```
72+
73+
### 指定头像的形状
74+
75+
circle 圆头像
76+
square 正方形头像
77+
78+
```jsx mdx:preview
79+
import React from 'react';
80+
import { View } from 'react-native';
81+
import { Avatar } from '@uiw/react-native';
82+
83+
function Demo() {
84+
return (
85+
<View style={{ flexDirection: 'row',justifyContent:'space-around' }}>
86+
<Avatar shape='circle' src="https://avatars.githubusercontent.com/u/24369183?v=4" />
87+
<Avatar rounded='square' src="https://avatars.githubusercontent.com/u/24369183?v=4" />
88+
</View>
89+
);
90+
}
91+
92+
export default Demo
93+
94+
```
2995
### Props
3096

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

packages/core/src/Badge/README.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,50 @@ function Demo() {
2121

2222
export default Demo;
2323

24+
```
25+
### 设置文本内容
26+
27+
28+
```jsx mdx:preview
29+
import React from "react"
30+
import { View, Text } from 'react-native';
31+
import { Badge } from '@uiw/react-native';
32+
33+
function Demo() {
34+
return (
35+
<View style={{ flexDirection: 'row',justifyContent:'space-around' }}>
36+
<Badge text="设置" color="red" />
37+
<Badge text="文本" color="red" />
38+
<Badge text="内容" color="red" />
39+
<Badge text="内容" color="red" />
40+
</View>
41+
);
42+
}
43+
44+
export default Demo;
45+
46+
```
47+
48+
### 设置颜色
49+
50+
```jsx mdx:preview
51+
import React from "react"
52+
import { View, Text } from 'react-native';
53+
import { Badge } from '@uiw/react-native';
54+
55+
function Demo() {
56+
return (
57+
<View style={{ flexDirection: 'row',justifyContent:'space-around' }}>
58+
<Badge text="红色" color="red" />
59+
<Badge text="黄色" color="yellow" />
60+
<Badge text="黑色" color="black" />
61+
<Badge text="绿色" color="green" />
62+
</View>
63+
);
64+
}
65+
66+
export default Demo;
67+
2468
```
2569
### 设置类型
2670

@@ -32,9 +76,11 @@ import { Badge } from '@uiw/react-native';
3276

3377
function Demo() {
3478
return (
35-
<View style={{ flexDirection: 'row' }}>
36-
<Text>一文带你搞懂 API 网关</Text>
79+
<View style={{ flexDirection: 'row',justifyContent:'space-around' }}>
3780
<Badge text="标记" type="dot" color="skyblue" />
81+
<Badge text="标记" type="dot" color="black" />
82+
<Badge text="标记" color="red" />
83+
<Badge text="标记" color="green" />
3884
</View>
3985
);
4086
}

packages/core/src/Ellipsis/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,27 @@ function Demo() {
2121
export default Demo;
2222
```
2323

24+
### 自定义占位符
25+
26+
27+
```jsx mdx:preview
28+
import React from "react"
29+
import { Ellipsis } from '@uiw/react-native';
30+
31+
function Demo() {
32+
33+
return (
34+
<Ellipsis maxLen={5} placeholder='😂😂😂😂'>用于文本过长,超出长度显示</Ellipsis>
35+
);
36+
}
37+
38+
export default Demo;
39+
```
40+
2441
### Props
2542

2643
| 参数 | 说明 | 类型 | 默认值 |
2744
|------|------|-----|------|
2845
| `children` | 内容为纯文本起作用 | ReactNode | - |
2946
| `maxLen` | 文本长度 | Number | - |
30-
| `placeholder` | 超出占位符 | String | `...` |
47+
| `placeholder` | 自定义占位符 | String | `...` |

packages/core/src/Grid/README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,27 @@ Grid 宫格
66

77
### 基础示例
88

9+
```jsx mdx:preview
10+
import { Grid, Icon } from '@uiw/react-native';
11+
import React from "react"
12+
13+
14+
const data = Array.from(new Array(10)).map((_val, i) => {
15+
16+
return { icon: <Icon name="heart-on" color="red" />, text: `${i}`}
17+
});
18+
19+
function Demo() {
20+
return (
21+
<Grid data={data} />
22+
);
23+
}
924

25+
export default Demo
26+
27+
```
28+
29+
### 自定义列数
1030

1131
```jsx mdx:preview
1232
import { Grid, Icon } from '@uiw/react-native';
@@ -20,7 +40,29 @@ const data = Array.from(new Array(10)).map((_val, i) => {
2040

2141
function Demo() {
2242
return (
23-
<Grid data={data} />
43+
<Grid data={data} columns='6'/>
44+
);
45+
}
46+
47+
export default Demo
48+
49+
```
50+
51+
### 是否需要间隔线
52+
53+
```jsx mdx:preview
54+
import { Grid, Icon } from '@uiw/react-native';
55+
import React from "react"
56+
57+
58+
const data = Array.from(new Array(24)).map((_val, i) => {
59+
60+
return { icon: <Icon name="heart-on" color="red" />, text: `${i}`}
61+
});
62+
63+
function Demo() {
64+
return (
65+
<Grid data={data} columns='6' hasLine={false}/>
2466
);
2567
}
2668

packages/core/src/Input/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,8 @@ export default Demo
161161
| `style` | 输入框样式 | `StyleProp<TextStyle>` | - |
162162
| `containerStyle` | 容器样式 | `StyleProp<ViewStyle>` | - |
163163

164+
<<<<<<< HEAD
165+
166+
> 更多 react-native Input 属性请参考 react-native TextInput (https://www.react-native.cn/docs/textinput)
167+
=======
168+
>>>>>>> dev

0 commit comments

Comments
 (0)