export function copyText(txt) {
const transfer = document.createElement('input');
document.body.appendChild(transfer);
transfer.value = txt; // 这里表示想要复制的内容
transfer.focus();
transfer.select();
if (document.execCommand) {
document.execCommand('copy');
message.success('复制成功');
}
transfer.blur();
document.body.removeChild(transfer);
}
网友评论