<el-button @click="clickCopy">
复制Url
</el-button>
clickCopy() {
const aux = document.createElement('input')
aux.setAttribute('value',copyText)
document.body.appendChild(aux)
aux.select()
document.execCommand('copy')
document.body.removeChild(aux)
if (document.execCommand('copy')) {
this.$message.success('复制成功')
} else {
this.$message.error('复制失败')
}
},
网友评论