<view class="order_info_text">{{orderData.order_num}} <text class="copy" data-order_num="{{orderData.order_num}}" bind:tap="copy">复制</text> </view>
js
copy: function ({
currentTarget: {
dataset: { order_num }
}
}) {
console.log(order_num);
wx.setClipboardData({
//准备复制的数据
data: order_num,
success: function (res) {
wx.showToast({
title: \'复制成功\',
});
}
});
}