aboutsummaryrefslogtreecommitdiff
path: root/src/composable/copy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/composable/copy.ts')
-rw-r--r--src/composable/copy.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/composable/copy.ts b/src/composable/copy.ts
index c781950..dcaed84 100644
--- a/src/composable/copy.ts
+++ b/src/composable/copy.ts
@@ -7,7 +7,13 @@ export function useCopy({ source, text = 'Copied to the clipboard' }: { source?:
return {
async copy(content?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
- await copy(content);
+ if (source) {
+ await copy();
+ }
+ else {
+ await copy(content);
+ }
+
message.success(notificationMessage ?? text);
},
};