[微信小程序]小程序使用事件冒泡需要注意的问题
想要通过事件冒泡,获取到.item的data,WXML如下:
<view class="toolbar" catchtouchend="format">
<view class="item" data-name="list" data-value="ordered">
<text class="iconfont icon-youxuliebiao"></text>
<text class="name">有序列表</text>
</view>
</view>
上面的结构是无法在js中通过e.target.dataset获取到data-name和data-value的: