Skip to content

Commit 12ab9fa

Browse files
authored
Merge pull request #545 from nullptr-z/dev
docs(SpeedDial):修复文档遮挡,无法点击问题
2 parents fcfb8f7 + 11f9a57 commit 12ab9fa

File tree

6 files changed

+69
-36
lines changed

6 files changed

+69
-36
lines changed

packages/core/src/Button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default function ButtonView<T>(props: ButtonProps) {
105105
borderWidth = 0;
106106
}
107107
const buttonStyle = {
108-
backgroundColor,
108+
backgroundColor: backgroundColor || '#fff5',
109109
borderColor,
110110
borderWidth,
111111
borderRadius,

packages/core/src/Input/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,15 @@ const inputStyles = StyleSheet.create({
182182
flexDirection: 'row',
183183
alignItems: 'center',
184184
backgroundColor: 'transparent',
185+
border: '1px solid',
186+
paddingHorizontal: 5,
185187
},
186188
input: {
187189
flex: 1,
188190
color: '#000',
189191
backgroundColor: 'transparent',
190192
paddingVertical: 0,
193+
paddingTop: 5,
191194
},
192195
always: {
193196
borderWidth: 1,

packages/core/src/MenuDropdown/README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
MenuDropdown
1+
MenuDropdown 下拉菜单
22
---
33

4-
菜单下拉按钮
4+
展开式菜单
55

66

77
### 基础示例
@@ -24,26 +24,7 @@ const Demo = () => {
2424

2525
export default Demo;
2626
```
27-
### 按钮颜色
28-
2927

30-
```jsx mdx:preview
31-
import React, { Component } from 'react';
32-
import { Text } from 'react-native';
33-
import { MenuDropdown} from '@uiw/react-native';
34-
35-
const Demo = () => {
36-
return (
37-
<MenuDropdown title="菜单" color="skyblue">
38-
<MenuDropdown.Item><Text>首页</Text></MenuDropdown.Item>
39-
<MenuDropdown.Item><Text>个人中心</Text></MenuDropdown.Item>
40-
<MenuDropdown.Item><Text>列表</Text></MenuDropdown.Item>
41-
</MenuDropdown>
42-
);
43-
}
44-
45-
export default Demo;
46-
```
4728
### 加载状态
4829

4930

@@ -126,7 +107,6 @@ export default Demo;
126107

127108
### 按钮尺寸
128109

129-
130110
```jsx mdx:preview
131111
import React, { Component } from 'react';
132112
import { Text } from 'react-native';
@@ -203,6 +183,27 @@ const Demo = () => {
203183

204184
export default Demo;
205185
```
186+
187+
### 按钮颜色
188+
189+
```jsx mdx:preview
190+
import React, { Component } from 'react';
191+
import { Text } from 'react-native';
192+
import { MenuDropdown} from '@uiw/react-native';
193+
194+
const Demo = () => {
195+
return (
196+
<MenuDropdown title="菜单" color="skyblue">
197+
<MenuDropdown.Item><Text>首页</Text></MenuDropdown.Item>
198+
<MenuDropdown.Item><Text>个人中心</Text></MenuDropdown.Item>
199+
<MenuDropdown.Item><Text>列表</Text></MenuDropdown.Item>
200+
</MenuDropdown>
201+
);
202+
}
203+
204+
export default Demo;
205+
```
206+
206207
### props
207208

208209
组件继承 [`TouchableOpacity`](https://facebook.github.io/react-native/docs/touchableopacity#docsNav)

packages/core/src/MenuDropdown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function MenuDropdown(props: MenuDropdownProps) {
6161
};
6262
return (
6363
<View style={[styles.menuBox, { height: listHeight + 50 }]}>
64-
<Button {...btnProps} onPress={handleonPress} size={size}>
64+
<Button {...btnProps} color={btnProps.color} onPress={handleonPress} size={size}>
6565
<Text>{title}</Text>
6666
<Icon name={btnIcon} size={17} />
6767
</Button>

packages/core/src/SpeedDial/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ import { View, Text, Dimensions } from 'react-native';
1717

1818
function Demo() {
1919
return (
20-
<View style={{ height: 800, background: '#ddd' }}>
20+
<View style={{ height: 180, background: '#ddd' }}>
2121
<SpeedDial
2222
onOpen={()=>console.log('onOpen2')}
2323
onClose={()=>console.log('onClose')}
24+
bottom={750}
2425
children={[
2526
{
2627
icon: 'plus',
@@ -56,11 +57,12 @@ import { View, Text, Dimensions } from 'react-native';
5657

5758
function Demo() {
5859
return (
59-
<View style={{ height: 800, background: '#ddd' }}>
60+
<View style={{ height: 180, background: '#ddd' }}>
6061
<SpeedDial
6162
transitionDuration={2000}
6263
onOpen={()=>console.log('onOpen')}
6364
onClose={()=>console.log('onClose')}
65+
bottom={750}
6466
children={[
6567
{
6668
icon: 'plus',

packages/core/src/WingBlank/README.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ WingBlank 两翼留白
77

88

99
```jsx mdx:preview
10-
import React,{Component} from 'react';
11-
import { Text } from 'react-native';
10+
import React,{ Component } from 'react';
11+
import { View, Text } from 'react-native';
1212
import { WingBlank } from '@uiw/react-native';
1313

1414
function Demo() {
1515
return (
16-
<WingBlank>
17-
<Text>两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留白两翼留两翼留白两翼留白两翼留白两翼留白</Text>
18-
</WingBlank>
16+
<View>
17+
<WingBlank size="small">
18+
<Text>两翼留白</Text>
19+
</WingBlank>
20+
</View>
1921
);
2022
}
2123
export default Demo
2224
```
2325

24-
size两翼留白的间距,默认`default`
26+
`size`两翼留白的间距,默认`default`
2527

2628
```jsx mdx:preview
2729
import React,{Component,Fragment} from 'react';
@@ -32,13 +34,38 @@ function Demo() {
3234
return (
3335
<Fragment>
3436
<WingBlank size='small'>
35-
<Text>两翼留白两翼留白</Text>
37+
<Text>两翼留白</Text>
3638
</WingBlank>
3739
<WingBlank size='default'>
38-
<Text>两翼留白两翼留白</Text>
40+
<Text>两翼留白</Text>
3941
</WingBlank>
4042
<WingBlank size='large'>
41-
<Text>两翼留白两翼留白</Text>
43+
<Text>两翼留白</Text>
44+
</WingBlank>
45+
</Fragment>
46+
);
47+
}
48+
export default Demo
49+
```
50+
51+
两翼留白不换行
52+
53+
```jsx mdx:preview
54+
import React,{Component,Fragment} from 'react';
55+
import { Text } from 'react-native';
56+
import { WingBlank } from '@uiw/react-native';
57+
58+
function Demo() {
59+
return (
60+
<Fragment>
61+
<WingBlank size='small' style={{ display: 'inline' }}>
62+
<Text>两翼留白</Text>
63+
</WingBlank>
64+
<WingBlank size='small' style={{ display: 'inline' }}>
65+
<Text>两翼留白</Text>
66+
</WingBlank>
67+
<WingBlank size='small' style={{ display: 'inline' }}>
68+
<Text>两翼留白</Text>
4269
</WingBlank>
4370
</Fragment>
4471
);
@@ -50,4 +77,4 @@ export default Demo
5077

5178
| 参数 | 说明 | 类型 | 默认值|
5279
| ---- | ---- | ---- | ---- |
53-
| size | 两翼留白的间距 | `small`, `default`, `large` | `default` |
80+
| size | 两翼留白的间距 | `small`, `default`, `large` | `default` |

0 commit comments

Comments
 (0)