微信小程序 bind:click带参数的方法
1、js
companyCellClick:function(cid){
console.log(cid.currentTarget.dataset.cid);
}
2、xml
<block wx:for="{{list}}" wx:key="cid">
<van-cell title="{{item.cname}}" is-link/>
</block>
用法:
data-参数 = '值'
这样就可以了。
1、js
companyCellClick:function(cid){
console.log(cid.currentTarget.dataset.cid);
}
2、xml
<block wx:for="{{list}}" wx:key="cid">
<van-cell title="{{item.cname}}" is-link/>
</block>
用法:
data-参数 = '值'
这样就可以了。