复制功能实现
api:wx.setClipboardData({
data:Data,
success(res){
console.log(res)
},
fail(res){
console.log(res)
}
})
wx.ml
<view catchtap='copywxtap' data-password="{{'89788205'}}" class="b_top_text">口令:89788205</view>
wx.js
//复制 copywxtap:function(e){ let data = e.currentTarget.dataset.password wx.setClipboardData({ data, success: function (res) { console.log(res.data) // data // wx.showModal({ // // title: '提示', // content: '复制成功', // showCancel: false // }); }, fail:function(res){ console.log(res) } }) },