File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed
packages/core/src/SwipeAction Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff 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
840import React ,{ useRef } from ' react' ;
941import {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: ' 删除' ,
You can’t perform that action at this time.
0 commit comments