forked from github/dataease
Merge pull request #13009 from dataease/pr@dev-v2@refactor_table_multi_copy_wrap
refactor(图表): 表格单元格多选复制换行优化
This commit is contained in:
commit
6d737af26f
@ -555,14 +555,13 @@ export const copyString = (content: string, notify = false) => {
|
||||
const clipboard = navigator.clipboard || {
|
||||
writeText: data => {
|
||||
return new Promise(resolve => {
|
||||
const inputDom = document.createElement('input')
|
||||
inputDom.setAttribute('style', 'z-index: -1;position: fixed;opacity: 0;')
|
||||
inputDom.setAttribute('type', 'text')
|
||||
inputDom.setAttribute('value', data)
|
||||
document.body.appendChild(inputDom)
|
||||
inputDom.select()
|
||||
const textareaDom = document.createElement('textarea')
|
||||
textareaDom.setAttribute('style', 'z-index: -1;position: fixed;opacity: 0;')
|
||||
textareaDom.value = data
|
||||
document.body.appendChild(textareaDom)
|
||||
textareaDom.select()
|
||||
document.execCommand('copy')
|
||||
inputDom.remove()
|
||||
textareaDom.remove()
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user