mint-ui / mint-loadmore

A two-direction mobile load-more component for vue.js
MIT License
315 stars 102 forks source link

在列表项上加上v-link或者click事件,划动列表就会触发路由改变或者点击事件 #7

Closed parox2014 closed 8 years ago

parox2014 commented 8 years ago

代码如下:

<loadmore :bottom-method="onPullup"
                  bottom-pull-text="上拉加载更多"
                  bottom-loading-text="松开进行加载"
                  :bottom-all-loaded="!hasMore">

          <div>
            <product-item v-for="item of products"
                          @onbuy="onBuy"
                          @click="onProductItemClick(item)"
                          :product="item">

            </product-item>

          </div>
        </loadmore>
Leopoldthecoder commented 8 years ago

Hi,我这边试了一下,不会出现你说的问题。你那里是 100% 会触发吗?有没有使用 fastclick 之类的库?

parox2014 commented 8 years ago

@Leopoldthecoder 100%会触发,确实用了fastclick,是它引起的吗?有没有办法解决,谢谢大大

刚才把fastclick去掉了,确实没问题了

Leopoldthecoder commented 8 years ago

fastclick 的确是有这个问题,https://github.com/ftlabs/fastclick/issues/178 这里也有不少人遇到,可以看看 https://github.com/guardian/frontend/issues/9947 这里的方案。看起来最简单的方法是把 @ click 改成 @touchstart。