diff --git a/src/composables/use-link-field.ts b/src/composables/use-link-field.ts index 43e7b8377..e31ad93df 100644 --- a/src/composables/use-link-field.ts +++ b/src/composables/use-link-field.ts @@ -1,10 +1,11 @@ +import { ComponentInstance } from '../utils'; import { watch, inject } from 'vue'; export const FORM_KEY = 'vanForm'; export const FIELD_KEY = 'vanField'; export function useLinkField(getValue: () => unknown) { - const field = inject(FIELD_KEY, null) as any; + const field = inject(FIELD_KEY, null) as ComponentInstance | null; if (field && !field.childFieldValue.value) { field.childFieldValue.value = getValue; diff --git a/src/image/index.tsx b/src/image/index.tsx index 62d553137..dae832bef 100644 --- a/src/image/index.tsx +++ b/src/image/index.tsx @@ -7,7 +7,13 @@ import { onBeforeUnmount, getCurrentInstance, } from 'vue'; -import { isDef, addUnit, inBrowser, createNamespace } from '../utils'; +import { + isDef, + addUnit, + inBrowser, + createNamespace, + ComponentInstance, +} from '../utils'; import Icon from '../icon'; const [createComponent, bem] = createNamespace('image'); @@ -51,7 +57,7 @@ export default createComponent({ const imageRef = ref(); // TODO: types - const { $Lazyload } = getCurrentInstance()!.proxy as any; + const { $Lazyload } = getCurrentInstance()!.proxy as ComponentInstance; const style = computed(() => { const style: CSSProperties = {}; diff --git a/src/pull-refresh/index.tsx b/src/pull-refresh/index.tsx index 24d7b564b..a3b51c80b 100644 --- a/src/pull-refresh/index.tsx +++ b/src/pull-refresh/index.tsx @@ -109,7 +109,7 @@ export default createComponent({ if (status === 'normal') { return ''; } - return (props as any)[`${status}Text`] || t(status); + return props[`${status}Text` as const] || t(status); }; const renderStatus = () => {