mark使用
https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.htmlhttps://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.htmlhttps://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html
<view mark:myMark="last" bindtap="bindViewTap">
<button mark:anotherMark="leaf" bindtap="bindButtonTap">按钮</button>
</view>
在上述 WXML 中,如果按钮被点击,将触发 [代码]bindViewTap[代码] 和 [代码]bindButtonTap[代码] 两个事件,事件携带的 [代码]event.mark[代码] 将包含 [代码]myMark[代码] 和 [代码]anotherMark[代码] 两项。 Page({
bindViewTap: function(e) {
e.mark.myMark === "last" // true
e.mark.anotherMark === "leaf" // true
}
})
这里bindViewTap事件的e.mark对象里面没有anotherMark这个属性