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("复制成功")
})
}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;
}

Loading…
Cancel
Save