先来看index.wxml 文件
<view bindtap="father">
father
<view bindtap="son">son</view>
</view>
在来看index.js 文件
Page({
father(){
console.log('father')
},
son(){
console.log('son')
},
})
会发现点击 son 的时候 father 也会一起调用,这就是冒泡事件
我们应该修改 index.wxml 中的代码
<view catchtap="father">
father
<view catchtap="son">son</view>
</view>
log:<br />