diff options
author | 2023-04-23 16:12:11 +0200 | |
---|---|---|
committer | 2023-04-23 17:11:04 +0200 | |
commit | e88c1d5f2c369e19b60af1f1d6424de74020dd2f (patch) | |
tree | bb55818b3cff418daf1b8678741881bba905b536 /src/composable | |
parent | 362f2fa280fdab210074e9a7e01dde6187924d29 (diff) | |
download | it-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.ts | 6 | ||||
-rw-r--r-- | src/composable/queryParams.ts | 2 |
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); |