使用修饰符时,顺序很重要;相应的代码会以同样的顺序产生。因此,用 v-on:click.prevent.self
会阻止所有的点击,而 v-on:click.self.prevent
只会阻止对元素自身的点击。
注意
- 为兼容各端,事件需使用 v-on 或 @ 的方式绑定,请勿使用小程序端的
bind
和catch
进行事件绑定。 - 若需要禁止蒙版下的页面滚动,可使用
@touchmove.stop.prevent="moveHandle"
,moveHandle
可以用来处理touchmove
的事件,也可以是一个空函数。
<view class="mask" @touchmove.stop.prevent="moveHandle"></view>