taro-swipe-cell
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

taro-SwipeCell

基于Taro3、React的 taro SwipeCell 滑动单元格组件

复用性很低,主要提供一个思路, 使用ScrollView 会有在部分真机设备有兼容性问题;使用MovableView方式页面滑动就会有问题,目前这样思路是最优解决方案。

安装

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

Package Sidebar

Install

npm i taro-swipe-cell

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

6.01 kB

Total Files

5

Last publish

Collaborators

  • huangpengfei