基于Taro3、React的 taro SwipeCell 滑动单元格组件
npm install taro-SwipeCell
import SwipeCell from 'taro-SwipeCell'
参数 | 描述 | 类型 | 必传 | 默认值 |
---|---|---|---|---|
deleteItem |
删除事件 | Function | 是 | () => void |
children |
children | React.children | 是 |
import { FC, memo } from 'react'
import MySwipeCell from 'taro-SwipeCell'
import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
const Component: FC = () => {
// 删除当前item
const delItem = item => {
}
return (
<>
<MySwipeCell deleteItem={() => delItem(item)}>
<View className={styles.item}>
1111
</View>
</MySwipeCell>
</>
)
}
const Mall = memo(Component)
export default Mall