0.0.10 • Published 7 years ago

nuke-list-swipe-item v0.0.10

Weekly downloads
43
License
-
Repository
gitlab
Last release
7 years ago

NukeListSwipeItem

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

API

参数说明类型默认值
onPress点击触发事件func()
longPress长按触发事件,ios无法再长按状态下进行滑动,仅在disabledSwipe状态下可触发长按事件func()
touchStart非press触摸,触发条件没有onPress严格,用于配合实现滚动隐藏滑动项目func
stylelist item点击区域外观object{}
itemStylelist item滑块外观object{}
rightBtn右侧滑动出现的列表array[]
leftBtn左侧滑动出现的列表array[]
indent滑动回弹距离number100
id当前item的唯一标识,建议制定,不建议使用序列indexstring
expand滑块展开的回调function(e)
threshold自动收回的阈值number0.5
disabledSwipe禁用左右滑动boolfalse
current当前点击项目string''
deleteAnimation移除item的动画效果todostringdefault、none
insertAnimation(string)插入item的动画效果todostringdefault、none

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

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

如需主动关闭当前滑动,只需将current置空

  • rightBtn | leftBtn 的内容需满足
let rightBtn = [{
    id: '按钮1的唯一标识',
	text: '按钮1内的文字内容',
	style:{
        height:80,
        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

注意

本组件依赖于aliweex最新expressBinding新特性,低于5.8.7的IOS千牛手淘iOS 6.4.0``天猫 iOS 5.30.1 手淘 Android 6.3.0`` 天猫 Android 5.28.1无法拖拽,只能通过disable拖拽改为长按降级。

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago