youzan / vant

A lightweight, customizable Vue UI library for mobile web apps.
https://vant.pro/vant/
MIT License
23.28k stars 9.49k forks source link

swipe item内的点击事件会在滑动时触发 #1153

Closed xuxiaoxiao312 closed 6 years ago

xuxiaoxiao312 commented 6 years ago

What is the current behavior? 开启swipe 手势滑动时,滑动会同时触发内部自定义的点击事件

        <Swipe :autoplay="3000">
            <SwipeItem v-for="ad in res.ads" :key="ad.id">
                <img class="swiper-img" v-lazy="ad.img" @click.self="redirect()">
            </SwipeItem>
        </Swipe>

What is the expected behavior? 手势滑动时,不应同时触发内部点击

Which versions of Vant and Vue, and which browser / OS are affected by this issue? Did this work in previous versions of Vant? "vant": "^1.1.4", "vue": "^2.5.13",

Saber-tgb commented 6 years ago

请问怎么解决的

chang888 commented 5 years ago

请问怎么解决的 谢谢

qianzhaoy commented 5 years ago

https://github.com/youzan/vant/issues/2031#issuecomment-435803037

YanJunXie commented 5 years ago

请问如何解决的,急~

chang888 commented 5 years ago

使用了 fastclick 了吧. 在 swipe 上加 needsclick 的 class. 应该能解决. 或者别用 fastclick 了

2031 (comment)

在 2019-01-02 09:14:13,"YanJun" notifications@github.com 写道:

请问如何解决的,急~

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

YanJunXie commented 5 years ago

使用了 fastclick 了吧. 在 swipe 上加 needsclick 的 class. 应该能解决. 或者别用 fastclick 了 #2031 (comment) 在 2019-01-02 09:14:13,"YanJun" notifications@github.com 写道: 请问如何解决的,急~ — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

我试过加这个class了,不好用啊,而且我去掉fastclick也不好用

M69W commented 5 years ago

使用了 fastclick 了吧. 在 swipe 上加 needsclick 的 class. 应该能解决. 或者别用 fastclick 了 #2031 (comment) 在 2019-01-02 09:14:13,"YanJun" notifications@github.com 写道: 请问如何解决的,急~ — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

我试过加这个class了,不好用啊,而且我去掉fastclick也不好用

去掉fastclick引用,问题解决