///*模版部分*/
<el-table-column prop="url" align="center" label="连接地址">
<template slot-scope="scope">
<div @click="handelCopy(scope.row.url)">{{scope.row.url}}</div>
</template>
</el-table-column>
/*js部分*/
//复制链接
copy(data) {
let url = data;
let oInput = document.createElement('input');
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // 选择对象
document.execCommand('Copy'); // 执行浏览器复制命令
this.$message({
showClose: true,
message: '复制成功',
type: 'success'
});
oInput.remove();
},
handelCopy(url) {
this.copy(url);
},
element ui 表格点击复制链接地址
最新推荐文章于 2024-06-20 16:42:38 发布