<el-table-column label="地址" show-overflow-tooltip> <template slot-scope="scope">
<div ref="textDom" @click="copyText(scope.row.url)" style="cursor: pointer" title="点击可复制" > {{ scope.row.url }} </div>
<textarea ref="inputDom" class="inputDom">我是替身</textarea> </template>
</el-table-column>
copyText(value) {
this.$nextTick(() => {
this.$refs.inputDom.value = value this.$refs.inputDom.select()
document.execCommand('Copy')
this.$message.success('复制成功')
}
.inputDom { cursor: pointer; opacity: 0; position: absolute; }