# nuke-biz-list-swipe-item

> listView子组件用于实现左右滑动

Latest version **0.0.3** (published 2017-10-31) · 0 weekly downloads

## Install

```sh
npm install nuke-biz-list-swipe-item
pnpm add nuke-biz-list-swipe-item
yarn add nuke-biz-list-swipe-item
bun add nuke-biz-list-swipe-item
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-10-31 |
| First published | 2017-07-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | doub7 |
| Maintainers | doub |
| Keywords | nuke, nuke-biz, nuke-biz-list-swipe-item |

## Links

- npm: https://www.npmjs.com/package/nuke-biz-list-swipe-item
- Repository: git@gitlab.alibaba-inc.com:nuke-biz/nuke-biz-list-swipe-item
- npm.io page: https://npm.io/package/nuke-biz-list-swipe-item

## Dependencies (1)

- [component-emitter](https://npm.io/package/component-emitter.md) ^1.2.1

## Recent versions

- 0.0.3 (latest) — 2017-10-31
- 0.0.2 — 2017-07-25
- 0.0.1 — 2017-07-25

## README

# nuke-biz-list-swipe-item

- category: BizComponent
- chinese: listView子组件用于实现左右滑动
- type: 基本

---

## 注意

- 在该组件中添加id等同于为cell添加key，可以优化列表的重绘效率，同时滑块的自动隐藏也依赖于id

- 仅在weex环境下有效，H5将降级禁止滑动。

- 手势组件在android低端机型下会存在卡顿，建议在android机采用长按触发实现交互。

- 为防止左滑返回工作台，千牛端需使用sdk禁止返回，详情见示例demo。

## API

参数 | 说明 | 类型 | 默认值
-----|-----|-----|-----
onPress | 点击触发事件 |func | () |
longPress | 长按触发事件,ios无法再长按状态下进行滑动，仅在`disabledSwipe`状态下可触发长按事件 | func | () |
style  | list item点击区域外观 | object | {} |
itemStyle  | list item滑块外观 | object | {} |
rightBtn | 右侧滑动出现的列表 | array | [] |
leftBtn | 左侧滑动出现的列表 | array | [] |
indent | 滑动回弹距离 | number | 100 |
id | 当前item的唯一标识，建议指定 | string |  |
expand | 滑块展开的回调 | function | (e) |
threshold |自动收回的阈值 | number | 0.5 |
disabledSwipe | 禁用左右滑动  | bool | false |
deleteAnimation | 移除item的动画效果[todo] | string | default、none |
insertAnimation(string) | 插入item的动画效果[todo] | string | default、none |



- rightBtn | leftBtn 的内容需满足

```
let rightBtn = [{
    id: '按钮1的唯一标识',
	text: '按钮1内的文字内容',
	style:{
        height:80,  // 不设置height，则自适应按钮高度
        backgroundColor:'#ffffff'
    },
    textStyle:{
        color:'black'
    }
    onPress: (e,item)=>{console.log('delete1!');},
}, {
    id: '按钮2的唯一标识',
	text: '按钮2内的文字内容',
	style:{
        height:80,
        backgroundColor:'#ffffff'
    },
    textStyle:{
        color:'black'
    }
    onPress: ()=>{console.log('delete1!');},
}]
```

使用细节请参考：`docs/basic.md || docs/advance.md`

*注意*

本组件依赖于aliweex最新expressBinding新特性，低于`5.8.7的IOS千牛`及`手淘iOS 6.4.0``天猫 iOS 5.30.1` `手淘 Android 6.3.0`` 天猫 Android 5.28.1`无法拖拽，只能通过disable拖拽改为长按降级。较低端的android手机同时会存在拖拽效果不理想的情况，建议通过平台判断进行降级处理。

---
_Source: https://npm.io/package/nuke-biz-list-swipe-item · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
