复制链接到剪贴板
<el-table-column
label="操作"
fixed="right"
>
<template #default="{ row }">
<el-button @click="messageConfirm(row)" type="text" size="small" :disabled="row.status === '未通知' || row.status === '未填写'">信息确认</el-button>
<el-button type="text" size="small" @click="exportNewcomerInfo(row.id)">下载</el-button>
<el-button type="text" size="small" @click="copyUrl(row)">复制链接</el-button>
</template>
</el-table-column>
copyUrl (data) {
const inputTag = document.createElement('input');
document.body.appendChild(inputTag);
inputTag.setAttribute('value', data.url);
inputTag.select();
if (document.execCommand('copy')) {
document.execCommand('copy');
this.$message({
type: 'success',
message: 'URL已复制到剪切板',
});
}
document.body.removeChild(inputTag);
},