chore: rename composables folder

This commit is contained in:
chenjiahan
2020-11-16 11:41:46 +08:00
parent dc6330bcdc
commit 062cd546a9
60 changed files with 67 additions and 67 deletions
+15
View File
@@ -0,0 +1,15 @@
import { watch, inject } from 'vue';
import { FIELD_KEY } from '../field';
export function useLinkField(getValue: () => unknown) {
const field = inject(FIELD_KEY, null) as any;
if (field && !field.childFieldValue.value) {
field.childFieldValue.value = getValue;
watch(getValue, () => {
field.resetValidation();
field.validateWithTrigger('onChange');
});
}
}