1.0.0 • Published 2 years ago

taro-swipe-cell v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

taro-SwipeCell

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

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

npm.io

安装

npm install taro-SwipeCell

导入组件

import SwipeCell from 'taro-SwipeCell'

参数说明

参数描述类型必传默认值
deleteItem删除事件Function() => void
childrenchildrenReact.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