新建复制粘贴方法
This commit is contained in:
8
src/utils/copyToClipboard.ts
Normal file
8
src/utils/copyToClipboard.ts
Normal file
@@ -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}`);
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user