From 5cb5ce4bb91a1b85b2aaf79233ed0e32a0f59f86 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Sun, 5 Nov 2023 14:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=8D=E5=88=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/verfiy/vsuccess.vue | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pages/verfiy/vsuccess.vue b/pages/verfiy/vsuccess.vue index ed7806e..5efbbf8 100644 --- a/pages/verfiy/vsuccess.vue +++ b/pages/verfiy/vsuccess.vue @@ -86,20 +86,18 @@ import * as Verify from '@/utils/verify' this.$toast("复制成功") }) }else{ - var textarea = document.createElement('textarea'); - document.body.appendChild(textarea); - // 隐藏此输入框 - textarea.style.position = 'fixed'; - textarea.style.clip = 'rect(0 0 0 0)'; - textarea.style.top = '10px'; - // 赋值 - textarea.value = str; - // 选中 - textarea.select(); - // 复制 - document.execCommand('copy', true); - // 移除输入框 - document.body.removeChild(textarea); + const textArea = document.createElement('textArea') + textArea.value = str + textArea.style.width = 0 + textArea.style.position = 'fixed' + textArea.style.left = '-999px' + textArea.style.top = '10px' + textArea.setAttribute('readonly', 'readonly') + document.body.appendChild(textArea) + + textArea.select() + document.execCommand('copy') + document.body.removeChild(textArea) this.$toast("复制成功") } @@ -299,7 +297,7 @@ import * as Verify from '@/utils/verify' .footer_area{ width: 100vw; height: 100rpx; - position: fixed; + /* position: fixed; */ bottom: 60rpx; left: 0px; }