File tree Expand file tree Collapse file tree 2 files changed +6
-65
lines changed
packages/core/src/SwipeAction Expand file tree Collapse file tree 2 files changed +6
-65
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -34,80 +34,20 @@ function Demo() {
3434export 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' ;
10141import {SwipeAction } from ' @uiw/react-native' ;
10242import { View ,Text } from ' react-native'
10343
10444function 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 );
You can’t perform that action at this time.
0 commit comments