chore: components base

This commit is contained in:
Corentin Thomasset committed 2022-04-04 00:24:45 +02:00
1 parent 64c92a661c
commit 25a8659786
13 files changed
+821 -19

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { useClipboard } from '@vueuse/core';
import { useMessage } from 'naive-ui';
import type { Ref } from 'vue';
export function useCopy({ source, text = 'Copied to the clipboard' }: { source: Ref; text?: string }) {
const { copy } = useClipboard({ source });
const message = useMessage();
return {
async copy() {
await copy();
message.success(text);
},
};
}