- 参考官方 文档
- 阻止事件冒泡 从
catch:tap="xx"
改为@tap.native.stop="xx"
- 应用
<view class="parent" @click="parentFun"> <view @click.native.stop="testFun()"> 内容 </view> </view>
- 这样,点击“内容”就执行了
testFun
方法,不会向上发生事件冒泡了
catch:tap="xx"
改为 @tap.native.stop="xx"
<view class="parent" @click="parentFun">
<view @click.native.stop="testFun()">
内容
</view>
</view>
testFun
方法,不会向上发生事件冒泡了周凯
这个人很懒,什么都没留下
文章评论