ant-design-mobile ListView 下拉刷新与列表长按事件冲突解决方式
发布日期:2021-05-20 10:07:05
浏览次数:44
分类:技术文章
本文共 500 字,大约阅读时间需要 1 分钟。
1、 在使用ListView
列表实现下拉刷新的同时,需要满足长按列表Item
进入长按功能页面,
touchStart = () => { const { touchStartEvent } = this.props; this.pressTime = setTimeout(() => { touchStartEvent(); }, '500'); }; touchMove = () => { clearTimeout(this.pressTime); }; touchCancel = () => { }; // 长按事件 handleTouchEnd = () => { clearTimeout(this.pressTime); };
我发现下拉刷新在滑动的时候也是会触发到长按的定时器,所以要解决的方式就是在移动的时候也去清除长按的定时器事件
,即可。
转载地址:https://blog.csdn.net/weixin_45416217/article/details/114375621 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
不错!
[***.144.177.141]2024年04月03日 07时21分40秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
LeetCode题解(1508):子数组和排序后的区间和(Python)
2019-04-26
LeetCode题解(1509):三次操作后最大值与最小值的最小差(Python)
2019-04-26
LeetCode题解(1510):石子游戏IV(Python)
2019-04-26
LeetCode题解(1497):检查数组对是否可以被k整除(Python)
2019-04-26
LeetCode题解(0781):森林中的兔子(Python)
2019-04-26
LeetCode题解(0930):和相同的二元子数组(Python)
2019-04-26
LeetCode题解(0939):最小面积矩形(Python)
2019-04-26
LeetCode题解(0954):二倍数对数组(Python)
2019-04-26
LeetCode题解(0957):N天后的牢房(Python)
2019-04-26
LeetCode题解(0974):和可被K整除的子数组(Python)
2019-04-26
LeetCode题解(0981):基于时间的键值存储(Python)
2019-04-26
LeetCode题解(0992):K个不同呢的子数组(Python)
2019-04-26
LeetCode题解(1001):网格照明(Python)
2019-04-26
LeetCode题解(1044):最长重复子串(Python)
2019-04-26
LeetCode题解(1048):最长字符串链(Python)
2019-04-26
LeetCode题解(1072):按列翻转得到最大值等行数(Python)
2019-04-26
LeetCode题解(1086):前五科的均分(Python)
2019-04-26
LeetCode题解(1364):顾客的可信联系人数量(SQL)
2019-04-26
LeetCode题解(1369):获取最近第二次的活动(SQL)
2019-04-26
LeetCode题解(1378):使用唯一标识码替换员工ID(SQL)
2019-04-26