const copyTranslateResult = () => {
const copy = (e: any) => {
e.preventDefault()
e.clipboardData.setData('text/plain', 'content')
document.removeEventListener('copy', copy)
}
document.addEventListener('copy', copy)
document.execCommand("Copy");
};
<button onclick={copyTranslateResult}>copy</button>
copy复制代码
最新推荐文章于 2024-03-09 16:02:15 发布