pull/74/MERGE^2
gexinzhineng/gxzn27 2023-03-29 16:58:06 +08:00
parent 5bc785b0f7
commit 5024f0aed6
1 changed files with 21 additions and 9 deletions

View File

@ -166,14 +166,26 @@ const handleDetail = (row: FileApi.FileVO) => {
// ========== ==========
const handleCopy = async (text: string) => {
const { copy, copied, isSupported } = useClipboard({ source: text })
if (!isSupported.value) {
message.error(t('common.copyError'))
} else {
await copy()
if (unref(copied.value)) {
message.success(t('common.copySuccess'))
}
}
let url = text
let oInput = document.createElement('textarea')
oInput.value = url
document.body.appendChild(oInput)
oInput.select() // ;
// console.log(oInput.value)
document.execCommand('Copy') //
message.success(t('common.copySuccess'))
oInput.remove()
// const { copy, copied, isSupported } = useClipboard({ source: text, read: true })
// console.log(copy, 'copycopycopy')
// console.log(copied, 'copiedcopiedcopied')
// console.log(isSupported, 'isSupportedisSupportedisSupported')
// if (!isSupported.value) {
// message.error(t('common.copyError'))
// } else {
// await copy()
// if (unref(copied.value)) {
// message.success(t('common.copySuccess'))
// }
// }
}
</script>