uniapp:使用data-名称为函数传参,并在e.currentTarget.dataset.名称中获取
html<view class="btn-buyer" @tap="mybtn" data-buyer="buyer">我是买家</view>jsmybtn(e){console.log(e);console.log(e.currentTarget.dataset.index);}我写的这篇文章可能有帮助https://blog.csdn.ne...
·
html
<view class="btn-buyer" @tap="mybtn" data-buyer="buyer">
我是买家
</view>
js
mybtn(e){
console.log(e);
console.log(e.currentTarget.dataset.index);
}
我写的这篇文章可能有帮助
https://blog.csdn.net/Gabriel_wei/article/details/98042857
更多推荐
已为社区贡献11条内容
所有评论(0)