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();
困擾了很久終於搞定,同樣遇到這個問題的小伙伴可以照我的方法去做了!!