Skip to content

Commit 30f2295

Browse files
committed
doc(SwipeAction): 修改文档,删除多余案例
1 parent 6d90ba9 commit 30f2295

File tree

2 files changed

+6
-65
lines changed

2 files changed

+6
-65
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020

2121
- run: yarn install
2222
- run: npm run build
23+
- run: npm run test
2324
- run: npm run doc
2425
- run: rm -rf packages/docs/doc
2526
- run: mkdir -p packages/docs/doc

packages/core/src/SwipeAction/README.md

Lines changed: 5 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -34,80 +34,20 @@ function Demo() {
3434
export default Demo;
3535
```
3636
37-
### 禁用
38-
39-
```jsx
40-
import React,{ useRef } from 'react';
41-
import {SwipeAction} from '@uiw/react-native';
42-
import { View,Text } from 'react-native'
43-
44-
function Demo() {
45-
const ref = useRef()
46-
const right = [
47-
{
48-
text: '查看',
49-
color: 'orange',
50-
x: 250,
51-
},
52-
{
53-
text: '删除',
54-
color: 'red',
55-
x: 250,
56-
},
57-
];
58-
return (
59-
<SwipeAction ref={ref} buttonWidth={60} right={right}>
60-
<View><Text>滑动</Text></View>
61-
</SwipeAction>
62-
);
63-
}
64-
export default Demo;
65-
```
66-
67-
### 禁用
37+
### 从左侧滑出
6838
6939
```jsx
70-
import React,{ useRef } from 'react';
71-
import {SwipeAction} from '@uiw/react-native';
72-
import { View,Text } from 'react-native'
73-
74-
function Demo() {
75-
const ref = useRef()
76-
const right = [
77-
{
78-
text: '查看',
79-
color: 'orange',
80-
x: 250,
81-
},
82-
{
83-
text: '删除',
84-
color: 'red',
85-
x: 250,
86-
},
87-
];
88-
return (
89-
<SwipeAction ref={ref} buttonWidth={60} right={right}>
90-
<View><Text>滑动</Text></View>
91-
</SwipeAction>
92-
);
93-
}
94-
export default Demo;
95-
```
96-
97-
### 禁用
98-
99-
```jsx
100-
import React,{ useRef } from 'react';
40+
import React from 'react';
10141
import {SwipeAction} from '@uiw/react-native';
10242
import { View,Text } from 'react-native'
10343

10444
function Demo() {
105-
const ref = useRef()
106-
const right = [
45+
const left = [
10746
{
10847
text: '查看',
10948
color: 'orange',
11049
x: 250,
50+
onPress: () => ref?.current?.swipeable.close()
11151
},
11252
{
11353
text: '删除',
@@ -116,7 +56,7 @@ function Demo() {
11656
},
11757
];
11858
return (
119-
<SwipeAction ref={ref} buttonWidth={60} right={right}>
59+
<SwipeAction ref={ref} buttonWidth={60} left={left}>
12060
<View><Text>滑动</Text></View>
12161
</SwipeAction>
12262
);

0 commit comments

Comments
 (0)