function copy() {
const CInput = document.createElement('input')
CInput.value = "asdjald@@#!SDADA4a566" //需要复制的数据
document.body.appendChild(CInput)
CInput.select()
document.execCommand("Copy")
CInput.remove()
//提示一个复制成功
ElMessage({
message: '已复制',
type: 'success',
});
}
点击button 实现复制功能
最新推荐文章于 2023-04-06 10:32:08 发布