博客
关于我
uniapp uni.setClipboardData成功默认提示
阅读量:173 次
发布时间:2019-02-28

本文共 495 字,大约阅读时间需要 1 分钟。

在`uni.setClipboardData`的`success`回调中添加`uni.hideToast()`可以有效解决数据复制时的异常显示问题。以下是完整的代码示例:```javascriptuni.setClipboardData({    data: 'hello uniapp',    success: function() {        // 在success中加入uni.hideToast()可以解决异常显示问题        uni.hideToast();        // 可以根据实际需求自定义操作    },    fail: function(err) {        uni.showToast({            title: '复制失败',            duration: 2000,            icon: 'none'        });    }});

需要注意的是,在success回调中必须调用uni.hideToast(),否则可能会出现异常显示现象。fail回调中则可以根据需要显示错误提示信息。

```

转载地址:http://lxec.baihongyu.com/

你可能感兴趣的文章
Qt高级——Qt元对象系统源码解析
查看>>
qt调用vs2008编写的dll动态库(隐式调用)
查看>>
Qt读取注册表默认值
查看>>
poj 1679 判断MST是不是唯一的 (次小生成树)
查看>>
POJ 1703 Find them, Catch them
查看>>
POJ 1703 Find them, Catch them 并查集
查看>>
POJ 1738 An old Stone Game(石子合并)
查看>>
POJ 1740 A New Stone Game(博弈)题解
查看>>
Qt网络编程之实例二POST方式
查看>>
POJ 1765 November Rain
查看>>
poj 1860 Currency Exchange
查看>>
POJ 1961 Period
查看>>
POJ 2019 Cornfields (二维RMQ)
查看>>
poj 2057 The Lost House 贪心思想在动态规划上的应用
查看>>
poj 2057 树形DP,数学期望
查看>>
poj 2112 最优挤奶方案
查看>>
Qt编写自定义控件12-进度仪表盘
查看>>
SpringBoot主启动原理在SpringApplication类《第六课》
查看>>
poj 2186 Popular Cows :求能被有多少点是能被所有点到达的点 tarjan O(E)
查看>>
POJ 2186:Popular Cows Tarjan模板题
查看>>