欢迎光临,了解微信小程序开发,就上易用通!

微信小程序小技巧系列《三》列表左右滑动,左滑删除功能实现 ... ...

发布:2018-01-31 10:42浏览: 来源:网络 作者:cola

微信小程序小技巧系列《三》列表左右滑动,左滑删除功能实现 ... ...(图1)

 

关键js代码如下:

 


  1. //关闭所有列表的的active
    closeLeftActive : function(sendUserId){
    var front__lists = this.data.front__lists,
    lists = this.data.lists,
    result;
    const fllen = front__lists.length,
    llen = lists.length;
    
    for(var i = 0; i < fllen; i++){
    front__lists[i]['isMoveLeft'] = false;
    front__lists[i]['moveLeftX'] = 0;
    if(sendUserId && sendUserId == front__lists[i]['sendUserId']){
    this.touchElement = {
    t : 'front__lists',
    i : i
    }
    }
    }
    for(var i = 0; i < llen; i++){
    lists[i]['isMoveLeft'] = false;
    lists[i]['moveLeftX'] = 0;
    if(sendUserId && sendUserId == lists[i]['sendUserId']){
    this.touchElement = {
    t : 'lists',
    i : i
    }
  2. <span class="pln" o="" cl="" ptm="" pbm"="" style="word-wrap: break-word; margin: 0px; padding: 0px;">




免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。