在组件的父级元素修改默认的事件
@touchmove.stop.prevent=“() => { }”
<view @touchmove.stop.prevent="() => { }">
<u-datetime-picker :show="isOpenDateHMS" @cancel="isOpenDateHMS = false" :minDate="getMillisecond()"
@confirm="closeDateHMS" mode="datetime">
</u-datetime-picker>
</view>

这篇博客介绍了如何在Vue组件的父级元素上阻止默认的touchmove事件,使用`@touchmove.stop.prevent`修饰符来实现。示例中展示了在<view>组件内包含一个<u-datetime-picker>,通过事件绑定防止触摸移动事件的默认行为。

3万+

被折叠的 条评论
为什么被折叠?



