小程序点击按钮复制页面文字代码
// pages/obj_order_base/obj_order_base.jsPage({ /** * 页面的初始数据 */ data: { order_name:"订单编号:", order_ids:"21435643645765867879" }, }) }, // 一键复制事件 copyBtn: function (e) { var that = this; wx.setClipboardData({ //准备复制的数据 data: that.data.order_name + that.data.order_ids, success: function (res) { wx.showToast({ title: '复制成功', }); } }); },})!-- 最外层视图page --view class='page'!-- 标签名称 --view class='conents_lab'label class='shop_left'{{order_name}}text selectable='true' bindlongtap='copy'{{order_ids}}/text/label/view!-- 复制 --label class='lab_copy' bindtap='copyBtn'复制/label/view
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

