js复制内容到剪切板
/**
* @description: 复制数据
* @param val
* @return String
*/
export const copyValue = (val) => {
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', val)
input.select()
if (document.execCommand('copy')) {
this.$message.success('复制成功')
} else {
this.$message.error('复制失败')
}
document.body.removeChild(input)
}