1、复制内容到剪贴板
const input = document.createElement('input')
input.setAttribute('readonly', 'readonly')
input.setAttribute('value', this.doc)
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, 9999)
document.execCommand('Copy')
document.body.removeChild(input)
2、复制内容到剪贴板(保留换行)
const input = document.createElement('textarea')
// input.setAttribute('value', this.doc) // 这样子不行
input.value = this.doc
document.body.appendChild(input)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)