使用 navigator 提供的剪贴板能力复制
export const useCopy = async (str: string) => { try { await navigator.clipboard.writeText(str) console.log('复制成功') } catch (e) { console.log('复制失败') } }
标签:console,log,点击,复制,str,按钮,navigator From: https://www.cnblogs.com/veinyin/p/16871601.html