Browse Source

fix: form change value not trigger validate #4955

close $4955
pull/4956/head
tangjinzhou 3 years ago
parent
commit
79ae8006a8
  1. 12
      components/form/FormItem.tsx

12
components/form/FormItem.tsx

@ -285,6 +285,12 @@ export default defineComponent({
resetField, resetField,
}); });
// instead useProvideFormItemContext onFieldChange
watch(fieldValue, () => {
if (props.autoLink) {
onFieldChange();
}
});
useProvideFormItemContext( useProvideFormItemContext(
{ {
id: fieldId, id: fieldId,
@ -294,9 +300,9 @@ export default defineComponent({
} }
}, },
onFieldChange: () => { onFieldChange: () => {
if (props.autoLink) { // if (props.autoLink) {
onFieldChange(); // onFieldChange();
} // }
}, },
clearValidate, clearValidate,
}, },

Loading…
Cancel
Save