diff --git a/src/utils/copyToClipboard.ts b/src/utils/copyToClipboard.ts new file mode 100644 index 0000000..d264d2e --- /dev/null +++ b/src/utils/copyToClipboard.ts @@ -0,0 +1,8 @@ +import { message } from "ant-design-vue"; + +// 复制到剪贴板 +export const handleCopy = async (text: string | number | undefined) => { + if (!text) return; + await navigator.clipboard.writeText(String(text)); + message.success(`已复制: ${text}`); +};