加入收藏 | 设为首页 | 会员中心 | 我要投稿 惠州站长网 (https://www.0752zz.com.cn/)- 办公协同、云通信、物联设备、操作系统、高性能计算!
当前位置: 首页 > 站长百科 > 正文

vue swipeCell滑动单元格(仿微信)的实现示例

发布时间:2020-10-30 18:16:48 所属栏目:站长百科 来源:网络整理
导读:副标题#e# 短视频,自媒体,达人种草一站服务 这篇文章主要介绍了vue swipeCell滑动单元格(仿微信)的实现示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧 抽离Vant weapp滑

onTouchEnd() {
   if (this.disabled) {
    return;
   }
   //回弹
   this.elasticX = 0
   if (this.dragging) {
    this.toggle(this.offset > 0 ? 'left' : 'right');
    this.dragging = false;
    // compatible with desktop scenario
    setTimeout(() => {
     this.lockClick = false;
    }, 0);
   }
  },

toggle(direction) {
   const offset = Math.abs(this.offset);
   const THRESHOLD = 0.15;
   const threshold = this.opened ? 1 - THRESHOLD : THRESHOLD;
   const { computedLeftWidth, computedRightWidth } = this;

if (
   computedRightWidth &&
   direction === 'right' &&
   offset > computedRightWidth * threshold
   ) {
    this.open('right');
   } else if (
   computedLeftWidth &&
   direction === 'left' &&
   offset > computedLeftWidth * threshold
   ) {
    this.open('left');
   } else {
    this.close();
   }
  },

onClick(position = 'outside') {
   this.$emit('click', position);

(编辑:惠州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

推荐文章
    热点阅读