小程序里点击按钮复制文案-小程序商城怎么推广文案-小程序商城如何推广
1.
index.js代码
2.Page({
3./*页面的初始数据*/
4.data:{
5.order_ids:"http://t.cn/Rgh0o1T"
6.},
7.//一键复制事件
8.copyBtn:function(e){
9.varthatthis;
10.wx.setClipboardData({
11.//准备复制的数据
12.data:that.data.order_ids,
13.success:function(res){
14.wx.showToast({
15.title:'复制成功',
16.});
17.}
18.});
19.}
20.})
21.index.wxml中代码
22.!--标签名称--
23.textselectable'true'bindlongtap'copy'{{order_ids}}/text
24.!--复制--
25.labelclass'lab_copy'bindtap'copyBtn'复制/label
26.注:如果单纯是长按复制文案,直接在text中加入一个selectable'true'属性就行
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

