diff --git a/.changeset/ninety-yaks-retire.md b/.changeset/ninety-yaks-retire.md new file mode 100644 index 00000000..bc5bced9 --- /dev/null +++ b/.changeset/ninety-yaks-retire.md @@ -0,0 +1,5 @@ +--- +"unify-ui": patch +--- + +Resolve the issue of incorrect validation status for form fields diff --git a/src/components/data-entry/Form/Form.vue b/src/components/data-entry/Form/Form.vue index e69d6b12..387a118f 100644 --- a/src/components/data-entry/Form/Form.vue +++ b/src/components/data-entry/Form/Form.vue @@ -53,6 +53,14 @@ function validate() { formItem.validateMessage = error.message as string; } }); + + state.formItems.forEach((formItem, name) => { + if (!errors.find((error) => error.field === name)) { + formItem.validateStatus = "success"; + formItem.validateMessage = ""; + } + }); + reject("validate failed"); } else { state.formItems.forEach((formItem, name) => {