当前位置:网站首页>Uniapp copy contents to clipboard
Uniapp copy contents to clipboard
2022-06-29 22:51:00 【Front end young master Jia】
1、 Introduce
vue-clipboard2 It is a plug-in that the front end can call the clipboard . Specific description there are also specific instructions on the official website ,
npm Address
github Address
2、 install
npm install --save vue-clipboard23、main.js register
// Copy text plugin
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
4、 Use
<view @click="copyText(' Copy content ')"> Copy </view>
// Copy
copyText(text) {
console.log(text);
// #ifdef H5
this.$copyText(text).then(
res => {
uni.showToast({
title: ' Replication success '
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: text,
success: () => {
uni.showToast({
title: ' Replication success '
})
}
})
// #endif
},app Version number comparison
compareVersion(version1, version2) {
console.log(version1, version2, ' I was executed. The current version is ' + version1 + ' The minimum version is ' + version2)
const v1 = version1.split('.');
const v2 = version2.split('.');
for (let i = 0; i < v1.length || i < v2.length; i++) {
let x = 0,
y = 0;
if (i < v1.length) {
x = parseInt(v1[i]);
}
if (i < v2.length) {
y = parseInt(v2[i])
}
if (x > y) return 1;
if (x < y) return -1;
}
return 0;
},边栏推荐
- Qt中使用QDomDocument和QDomnode来读取xml
- 合宙AIR32F103CBT6开发板上手报告
- 交友平台小程序制作开发代码分享
- Weekly Postgres world news 2022w25
- js函数相关的复习
- Does rapid software delivery really need to be at the cost of security?
- The soft youth under the blessing of devcloud makes education "smart" in the cloud
- Is it safe to open a stock account? Shanghai stock account opening.
- Detailed description of gaussdb (DWS) complex and diverse resource load management methods
- VS无法定位程序输入点于动态链接库
猜你喜欢

Low code, end-to-end, one hour to build IOT sample scenarios, and the sound network released lingfalcon Internet of things cloud platform

从零实现深度学习框架——LSTM从理论到实战【理论】
![leetcode:91. Decoding method [DFS + memorization]](/img/8d/9f61961fa9cfc6809a7800913e8761.png)
leetcode:91. Decoding method [DFS + memorization]

分布式消息中间件设计
![Realizing deep learning framework from zero -- LSTM from theory to practice [theory]](/img/ac/164140eff1a6518d49ce25599d9c7b.png)
Realizing deep learning framework from zero -- LSTM from theory to practice [theory]

Discussion on distributed unique ID generation scheme

wirehark数据分析与取证infiltration.pacapng

Design of Distributed Message Oriented Middleware

One click file sharing software jirafeau

AI scene Storage Optimization: yunzhisheng supercomputing platform storage practice based on juicefs
随机推荐
详细聊聊MySQL中auto_increment有什么作用
Kr-gcn: an interpretable recommendation system based on knowledge aware reasoning
低代码、端到端,一小时构建IoT示例场景,声网发布灵隼物联网云平台
啃下大骨头——排序(一)
Is it safe to open an account on the flush? Where to apply for opening an account
Evolution from stand-alone to distributed database storage system
Wireshark data analysis and forensics information pacapng
从零实现深度学习框架——RNN从理论到实战【实战】
Does rapid software delivery really need to be at the cost of security?
Nacos-配置中心基本使用
分布式消息中间件设计
wirehark数据分析与取证infiltration.pacapng
什么是IGMP?IGMP与ICMP有啥区别?
Cloud native enthusiast weekly: cool collection of grafana monitoring panels
交友平台小程序制作开发代码分享
Mysql database: partition
leetcode 416. Partition equal subset sum partition equal subset sum (medium)
Optional类的高级使用
开源了 | 文心大模型ERNIE-Tiny轻量化技术,又准又快,效果全开
nrm详解