Vue 中 touch 事件无效解决方案
添加 .native.prevent 修饰符即可<van-buttonround@touchstart.native.prevent="onTouchStart"@touchmove.native.prevent="onTouchMove"@touchend.native.prevent="onTouchEnd">Hold to Talk</van-button>
·
添加 .native
修饰符绑定原生事件
<van-button
round
@touchstart.native="onTouchStart"
@touchmove.native="onTouchMove"
@touchend.native="onTouchEnd"
>
Hold to Talk
</van-button>
添加 .prevent
修饰符禁止浏览器默认行为(如长按弹出右键菜单等)
<van-button
round
@touchstart.native.prevent="onTouchStart"
@touchmove.native.prevent="onTouchMove"
@touchend.native.prevent="onTouchEnd"
>
Hold to Talk
</van-button>
更多推荐
已为社区贡献4条内容
所有评论(0)