Mint-ui中loadmore(上拉加载下拉刷新)组件在ios中滑动会触发点击事件的解决方法

bug说明:

Mint-ui中loadmore(上拉加载下拉刷新)组件 在 使用fastclick的情况下

,在ios设备中滑动会触发点击事件;

 

解决方法:

我是按需引入,去项目中找到loadmore下的index.js,全部引入的要找mint下面mint-ui.common.js

路径如下:你的项目名/node_modules\mint-ui\lib\loadmore\index.js

搜索 handleTouchEnd ,记得写event进去

handleTouchEnd: function handleTouchEnd(event) {...}
 

然后在down和up两个事件中加入 我标注的红字即可!

if (this.direction === 'down' && this.getScrollTop(this.scrollEventTarget) === 0 && this.translate > 0) {
event.preventDefault();
event.stopPropagation();
...
if (this.direction === 'up' && this.bottomReached && this.translate < 0) {
event.preventDefault();
event.stopPropagation();
...
 
 
困扰了很久终于搞定,同样遇到这个问题的小伙伴可以照我的方法去做了!!
posted @ 2017-11-10 16:54  王辉的个人博客  阅读(5314)  评论(2编辑  收藏  举报