Skip to content

Commit

Permalink
fix(model): auto validate on value change
Browse files Browse the repository at this point in the history
修复BasicModel的表单值发生变化时未能自动校验

fixed: #920
  • Loading branch information
mynetfan committed Jul 16, 2021
1 parent 5baaa58 commit f844017
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Form/src/BasicForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
function setFormModel(key: string, value: any) {
formModel[key] = value;
const { validateTrigger } = unref(getBindValue);
if (!validateTrigger || validateTrigger === 'change') {
try {
validateFields([key]);
} catch (e) {}
}
}
function handleEnterPress(e: KeyboardEvent) {
Expand Down

0 comments on commit f844017

Please sign in to comment.