Browse Source

修改复制功能

master
453530270@qq.com 2 years ago
parent
commit
5cb5ce4bb9
  1. 28
      pages/verfiy/vsuccess.vue

28
pages/verfiy/vsuccess.vue

@ -86,20 +86,18 @@ import * as Verify from '@/utils/verify'
this.$toast("复制成功") this.$toast("复制成功")
}) })
}else{ }else{
var textarea = document.createElement('textarea'); const textArea = document.createElement('textArea')
document.body.appendChild(textarea); textArea.value = str
// textArea.style.width = 0
textarea.style.position = 'fixed'; textArea.style.position = 'fixed'
textarea.style.clip = 'rect(0 0 0 0)'; textArea.style.left = '-999px'
textarea.style.top = '10px'; textArea.style.top = '10px'
// textArea.setAttribute('readonly', 'readonly')
textarea.value = str; document.body.appendChild(textArea)
//
textarea.select(); textArea.select()
// document.execCommand('copy')
document.execCommand('copy', true); document.body.removeChild(textArea)
//
document.body.removeChild(textarea);
this.$toast("复制成功") this.$toast("复制成功")
} }
@ -299,7 +297,7 @@ import * as Verify from '@/utils/verify'
.footer_area{ .footer_area{
width: 100vw; width: 100vw;
height: 100rpx; height: 100rpx;
position: fixed; /* position: fixed; */
bottom: 60rpx; bottom: 60rpx;
left: 0px; left: 0px;
} }

Loading…
Cancel
Save