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; }