mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 17:26:15 -04:00
feat(new tool): emoji picker (#551)
This commit is contained in:
parent
dfa1ba8554
commit
93f7cf0e98
11 changed files with 192 additions and 6 deletions
|
@ -1,14 +1,14 @@
|
|||
import { type MaybeRef, get, useClipboard } from '@vueuse/core';
|
||||
import { useMessage } from 'naive-ui';
|
||||
|
||||
export function useCopy({ source, text = 'Copied to the clipboard' }: { source: MaybeRef<unknown>; text?: string }) {
|
||||
const { copy } = useClipboard({ source: computed(() => String(get(source))) });
|
||||
export function useCopy({ source, text = 'Copied to the clipboard' }: { source?: MaybeRef<unknown>; text?: string } = {}) {
|
||||
const { copy } = useClipboard(source ? { source: computed(() => String(get(source))) } : {});
|
||||
const message = useMessage();
|
||||
|
||||
return {
|
||||
async copy() {
|
||||
async copy(content?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
|
||||
await copy();
|
||||
message.success(text);
|
||||
message.success(notificationMessage ?? text);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue