copyUrl是变量
直接copy变量的值到剪切板
var url = 'https://zcb.liansdk.com/#/newuploadzcb?id=' + params.row.id
this.copyUrl = url
this.copyContent()
copyContent() {
const input = document.createElement('input');
document.body.appendChild(input);
input.setAttribute('value', this.copyUrl);
input.select();
if (document.execCommand('copy')) {
document.execCommand('copy');
console.log('复制成功');
}
document.body.removeChild(input);
}
网友评论