如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
wxml
<button class="weui-btn" type="primary" plain="true" style='margin-top:50rpx;margin-button:50rpx;' bind:tap='copyText' data-text="{{res_old}}" >点击复制</button>
js
copyText:function(e){
console.log(e)
wx.setClipboardData({
data: e.currentTarget.dataset.text,
success: function (res) {
wx.getClipboardData({
success: function (res) {
wx.showToast({
title: '复制成功'
})
}
})
}
})
},
王明昌博客
