Skip to content

Commit 34766f9

Browse files
committed
test(SpeedDial):添加SpeedDial测试用例
1 parent 4932380 commit 34766f9

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

packages/core/src/SpeedDial/README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Demo() {
1919
return (
2020
<View style={{ height: 800, background: '#ddd' }}>
2121
<SpeedDial
22-
onOpen={()=>console.log('onOpen')}
22+
onOpen={()=>console.log('onOpen2')}
2323
onClose={()=>console.log('onClose')}
2424
children={[
2525
{
@@ -47,6 +47,45 @@ function Demo() {
4747
export default Demo
4848
```
4949

50+
### 设置动画时间
51+
52+
```jsx mdx:preview
53+
import React, { Fragment } from 'react';
54+
import { SpeedDial, Icon } from '@uiw/react-native';
55+
import { View, Text, Dimensions } from 'react-native';
56+
57+
function Demo() {
58+
return (
59+
<View style={{ height: 800, background: '#ddd' }}>
60+
<SpeedDial
61+
transitionDuration={2000}
62+
onOpen={()=>console.log('onOpen')}
63+
onClose={()=>console.log('onClose')}
64+
children={[
65+
{
66+
icon: 'plus',
67+
title: <Text>Add</Text>,
68+
onPress:()=>console.log('Add')
69+
},
70+
{
71+
icon: <Icon name='star-on' color="#fff" size={18} />,
72+
title: 'Star'
73+
},
74+
{
75+
icon: <Icon name='mail' color="#fff" size={18} />,
76+
title: 'Mail'
77+
},
78+
{
79+
icon: <Icon name='share' color="#fff" size={18} />,
80+
title: 'Share'
81+
}
82+
]}
83+
/>
84+
</View>
85+
);
86+
}
87+
export default Demo
88+
```
5089
### Props
5190

5291
| 参数 | 说明 | 类型 | 默认值|

0 commit comments

Comments
 (0)