mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 17:26:15 -04:00
fix(ts): cleaned legacy typechecking warning
This commit is contained in:
parent
362f2fa280
commit
e88c1d5f2c
7 changed files with 20 additions and 17 deletions
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue