在嵌套view 中有两个tap事件,加上了.stop修饰符,仍然出现了事件冒泡。
点击子view 会触发父级view的点击事件。
写法如下
<view @tap.stop="toReply(talk)" >
<view style="flex-direction: row;flex: 2;" @tap.stop="do_dianZan(talk)">
<text class="zanmin">{{ talk.number }}</text>
</view>
</view>
在嵌套view 中有两个tap事件,加上了.stop修饰符,仍然出现了事件冒泡。
点击子view 会触发父级view的点击事件。
写法如下
<view @tap.stop="toReply(talk)" >
<view style="flex-direction: row;flex: 2;" @tap.stop="do_dianZan(talk)">
<text class="zanmin">{{ talk.number }}</text>
</view>
</view>
1***@qq.com (作者)
多谢!
2019-09-29 12:32