types: reduce any

This commit is contained in:
chenjiahan
2021-03-02 20:12:52 +08:00
parent 6e5329cbe0
commit 7f4651bbbf
3 changed files with 11 additions and 4 deletions
+2 -1
View File
@@ -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;