pull/74/MERGE^2
parent
5bc785b0f7
commit
5024f0aed6
|
|
@ -166,14 +166,26 @@ const handleDetail = (row: FileApi.FileVO) => {
|
||||||
|
|
||||||
// ========== 复制相关 ==========
|
// ========== 复制相关 ==========
|
||||||
const handleCopy = async (text: string) => {
|
const handleCopy = async (text: string) => {
|
||||||
const { copy, copied, isSupported } = useClipboard({ source: text })
|
let url = text
|
||||||
if (!isSupported.value) {
|
let oInput = document.createElement('textarea')
|
||||||
message.error(t('common.copyError'))
|
oInput.value = url
|
||||||
} else {
|
document.body.appendChild(oInput)
|
||||||
await copy()
|
oInput.select() // 选择对象;
|
||||||
if (unref(copied.value)) {
|
// console.log(oInput.value)
|
||||||
message.success(t('common.copySuccess'))
|
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>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue