这段代码可以完全复制过去,仅需要更改input.value的内容
下文中的textarea改为input,也可以复制,但是不会保持格式,写为textarea时,就会保持格式
copyUrl () {
const input = document.createElement('textarea')
input.setAttribute('id', '__mouse__position_input')
input.value = `${this.url}`
document.querySelector('body').appendChild(input)
input.select()
document.execCommand('copy')
document.body.removeChild(input)
message.success('复制成功')
}