vue方法
默认情况下,事件在h5页面会穿透传递,比如一div里面套一个div,点击上层div,下层div也会响应 要阻止事件穿透,使用event.stopPropagation(); 代码示例:
<div @click="testout($event)>
<div @click="testin($event)"></div>
</div>
.......
testin(event) {
......
event.stopPropagation();
},
小程序方法
- catchtap:和bindtap相对应,catchtap有着阻止事件冒泡的作用;
- catchtouchmove:阻止浮层滑动穿透到页面上;