File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/core/src/SwipeAction Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,18 @@ SwipeAction 滑动操作组件。
55### 基础示例
66
77``` jsx
8- import React from ' react' ;
8+ import React ,{ useRef } from ' react' ;
99import {SwipeAction } from ' @uiw/react-native' ;
1010import { View ,Text } from ' react-native'
1111
1212function Demo () {
13+ const ref = useRef ()
1314 const right = [
1415 {
1516 text: ' 查看' ,
1617 color: ' orange' ,
1718 x: 250 ,
19+ onPress : () => ref? .current ? .swipeable .close ()
1820 },
1921 {
2022 text: ' 删除' ,
@@ -28,7 +30,7 @@ function Demo() {
2830 },
2931 ];
3032 return (
31- < SwipeAction buttonWidth= {60 } right= {right}>
33+ < SwipeAction ref = {ref} buttonWidth= {60 } right= {right}>
3234 < View>< Text > 滑动< / Text >< / View>
3335 < / SwipeAction>
3436 );
@@ -42,7 +44,7 @@ export default Demo;
4244|------|------|-----|------|
4345| ` right` | 右边滑动出来的元素 | Array<Column> | - |
4446| ` left` | 左边滑动出来的元素 | Array<Column> | - |
45- | ` buttonWidth ` | 按钮宽度 | string | number | 60 |
47+ | ` buttonWidth` | 按钮宽度 | number | 60 |
4648
4749### ColumnProps
4850| 参数 | 说明 | 类型 | 默认值 |
You can’t perform that action at this time.
0 commit comments