aboutsummaryrefslogtreecommitdiff
path: root/src/composable
diff options
context:
space:
mode:
authorGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2023-04-23 16:12:11 +0200
committerGravatar Corentin THOMASSET <corentin.thomasset74@gmail.com> 2023-04-23 17:11:04 +0200
commite88c1d5f2c369e19b60af1f1d6424de74020dd2f (patch)
treebb55818b3cff418daf1b8678741881bba905b536 /src/composable
parent362f2fa280fdab210074e9a7e01dde6187924d29 (diff)
downloadit-tools-e88c1d5f2c369e19b60af1f1d6424de74020dd2f.tar.gz
it-tools-e88c1d5f2c369e19b60af1f1d6424de74020dd2f.tar.zst
it-tools-e88c1d5f2c369e19b60af1f1d6424de74020dd2f.zip
fix(ts): cleaned legacy typechecking warning
Diffstat (limited to 'src/composable')
-rw-r--r--src/composable/copy.ts6
-rw-r--r--src/composable/queryParams.ts2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/composable/copy.ts b/src/composable/copy.ts
index c389001..af4921b 100644
--- a/src/composable/copy.ts
+++ b/src/composable/copy.ts
@@ -1,8 +1,8 @@
-import { useClipboard, type MaybeRef } from '@vueuse/core';
+import { useClipboard, type MaybeRef, get } from '@vueuse/core';
import { useMessage } from 'naive-ui';
-export function useCopy({ source, text = 'Copied to the clipboard' }: { source: MaybeRef<string>; text?: string }) {
- const { copy } = useClipboard({ source });
+export function useCopy({ source, text = 'Copied to the clipboard' }: { source: MaybeRef<unknown>; text?: string }) {
+ const { copy } = useClipboard({ source: computed(() => String(get(source))) });
const message = useMessage();
return {
diff --git a/src/composable/queryParams.ts b/src/composable/queryParams.ts
index b62c8b3..9699abb 100644
--- a/src/composable/queryParams.ts
+++ b/src/composable/queryParams.ts
@@ -26,7 +26,7 @@ function useQueryParam<T>({ name, defaultValue }: { name: string; defaultValue:
return computed<T>({
get() {
- return transformer.fromQuery(proxy.value) as T;
+ return transformer.fromQuery(proxy.value) as unknown as T;
},
set(value) {
proxy.value = transformer.toQuery(value as never);