This commit is contained in:
linfso 2024-10-09 13:11:15 +08:00
parent e9b23a3ae8
commit a705cd3b17

View File

@ -939,14 +939,11 @@ export default {
if (navigator.clipboard && window.isSecureContext) { if (navigator.clipboard && window.isSecureContext) {
// navigator clipboard 向剪贴板写文本 // navigator clipboard 向剪贴板写文本
this.$modal.msgSuccess('复制成功') this.$modal.msgSuccess('复制成功')
console.log("==...123=9=>",this.currentSelectStr)
return navigator.clipboard.writeText(this.currentSelectStr) return navigator.clipboard.writeText(this.currentSelectStr)
} else { } else {
// 创建text area // 创建text area
const textArea = document.createElement('textarea') const textArea = document.createElement('textarea')
textArea.value = this.currentSelectStr textArea.value = this.currentSelectStr
console.log("==...123=9000=>",textArea.value)
// 使text area不在viewport,同时设置不可见 // 使text area不在viewport,同时设置不可见
document.body.appendChild(textArea) document.body.appendChild(textArea)
textArea.focus() textArea.focus()