Skip to content

Commit 48b2c95

Browse files
ChenlingasMxhy
authored andcommitted
doc:SwipeAction文档优化
1 parent c55cb30 commit 48b2c95

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

packages/core/src/SwipeAction/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,40 @@ SwipeAction 滑动操作组件。
22
---
33
结合手势操作,从屏幕一侧唤出操作。
44

5+
![](https://user-images.githubusercontent.com/57083007/146733663-6c83fca4-72df-424d-8364-47533f57ece6.gif)
6+
57
### 基础示例
68

9+
```jsx
10+
import React from 'react';
11+
import {SwipeAction} from '@uiw/react-native';
12+
import { View,Text } from 'react-native'
13+
14+
function Demo() {
15+
const right = [
16+
{
17+
text: '查看',
18+
color: 'orange',
19+
x: 250,
20+
onPress: () => ref?.current?.swipeable.close()
21+
},
22+
{
23+
text: '删除',
24+
color: 'red',
25+
x: 250,
26+
},
27+
];
28+
return (
29+
<SwipeAction ref={ref} buttonWidth={60} right={right}>
30+
<View><Text>滑动</Text></View>
31+
</SwipeAction>
32+
);
33+
}
34+
export default Demo;
35+
```
36+
37+
### 禁用
38+
739
```jsx
840
import React,{ useRef } from 'react';
941
import {SwipeAction} from '@uiw/react-native';
@@ -16,7 +48,6 @@ function Demo() {
1648
text: '查看',
1749
color: 'orange',
1850
x: 250,
19-
onPress: () => ref?.current?.swipeable.close()
2051
},
2152
{
2253
text: '删除',

0 commit comments

Comments
 (0)