1.在绑定的元素上设置如下
<image src="{{item.img}}" mode="aspectFill" data-param="{{parameter}}" bindtap="tapTest" />
2.在js里取出来 data的值
tapTest: function (e) {
console.log(e.target.dataset.param)
//做其他处理
},
1.在绑定的元素上设置如下
<image src="{{item.img}}" mode="aspectFill" data-param="{{parameter}}" bindtap="tapTest" />
tapTest: function (e) {
console.log(e.target.dataset.param)
//做其他处理
},