fix(model): auto validate on value change

修复BasicModel的表单值发生变化时未能自动校验

fixed: #920
This commit is contained in:
无木 2021-07-16 13:14:24 +08:00
parent 5baaa58581
commit f8440175f3

View File

@ -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) {