feat: 首次提交

This commit is contained in:
peerless_hero
2023-08-17 21:28:49 +08:00
parent 36f80fb971
commit ec1e5e16cd
571 changed files with 95322 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,52 @@
// 本文件由FirstUI授权予新疆天衡创新研究院有限公司手机号 18 6 14 0 725 4 9身份证尾号5A07X5专用请尊重知识产权勿私下传播违者追究法律责任。
/*!
* 剪贴板
*
* 官网地址https://firstui.cn/
* 文档地址https://doc.firstui.cn/
*/
// #ifdef H5
import ClipboardJS from "./clipboard.min.js"
// #endif
/**
* data 需要复制的数据
* callback 回调
* e 当用户点击后需要先请求接口再进行复制时需要传入此参数H5端
* **/
const getClipboardData = function(data, callback, e) {
// #ifdef APP-PLUS || MP
uni.setClipboardData({
data: data,
success(res) {
("function" == typeof callback) && callback(true)
},
fail(res) {
("function" == typeof callback) && callback(false)
}
})
// #endif
// #ifdef H5
let event =window.event || e || {}
let clipboard = new ClipboardJS("", {
text: () => data
})
clipboard.on('success', (e) => {
("function" == typeof callback) && callback(true)
clipboard.off('success')
clipboard.off('error')
clipboard.destroy()
});
clipboard.on('error', (e) => {
("function" == typeof callback) && callback(false)
clipboard.off('success')
clipboard.off('error')
clipboard.destroy()
});
clipboard.onClick(event)
// #endif
}
export default {
getClipboardData: getClipboardData
};