IconPark icon indicating copy to clipboard operation
IconPark copied to clipboard

点击复制 标识 临时解决方法

Open BitmapLong opened this issue 1 year ago • 0 comments

F12 -> 切换到 Console

粘贴下面代码

const copy = (text) => { var textarea = document.createElement('textarea'); document.body.appendChild(textarea); // 隐藏此输入框 textarea.style.position = 'fixed'; textarea.style.clip = 'rect(0 0 0 0)'; textarea.style.top = '10px'; // 赋值 textarea.value = text; // 选中 textarea.select(); // 复制 document.execCommand('copy', true); document.body.removeChild(textarea); }

// 官方图标库 document.querySelectorAll('.icon-base-view').forEach(item => { item.addEventListener('click', event => { let text = event.target.parentNode.parentNode.querySelector('.name').innerText copy(text) }) })

// 项目管理 document.querySelectorAll('.styles_detailMainRow__1BR8z').forEach(item => { item.addEventListener('click', event => { let text = event.target.parentNode.parentNode.querySelector('.styles_subName__1Zdcm').innerText copy(text) }) })

ok, 可以愉快的只复制标识了

BitmapLong avatar Aug 02 '23 10:08 BitmapLong