bindtap绑定函数如何获取被点击的元素和属性值

来源:互联网 发布:csgo淘宝黄金版 编辑:程序博客网 时间:2024/06/17 21:58

1.在绑定的元素上设置如下

 <image src="{{item.img}}" mode="aspectFill" data-param="{{parameter}}" bindtap="tapTest" />

2.在js里取出来   data的值

tapTest: function (e) {   console.log(e.target.dataset.param)//做其他处理  },


阅读全文
0 0
原创粉丝点击