Skip to content

Commit

Permalink
fix: resolve the issue of incorrect validation status for form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
luohuidong committed Oct 27, 2023
1 parent be17cfa commit 1a0c808
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-yaks-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"unify-ui": patch
---

Resolve the issue of incorrect validation status for form fields
8 changes: 8 additions & 0 deletions src/components/data-entry/Form/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 1a0c808

Please sign in to comment.