From 70021db98f8288481a3b7c27e3183095fb60c042 Mon Sep 17 00:00:00 2001 From: tao Date: Mon, 12 Jan 2026 17:14:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=A4=8D=E5=88=B6=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/copyToClipboard.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/utils/copyToClipboard.ts 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}`); +};