copyLink = () => {
const input = document.createElement(‘input’);
document.body.appendChild(input);
input.setAttribute(
‘value’,
要复制的链接
);
input.select();
if (document.execCommand(‘copy’)) {
document.execCommand(‘copy’);
}
document.body.removeChild(input);
}
点击复制到粘贴板
最新推荐文章于 2024-11-08 14:35:14 发布