mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-23 17:50:25 +08:00
fix(model): auto validate on value change
修复BasicModel的表单值发生变化时未能自动校验 fixed: #920
This commit is contained in:
parent
5baaa58581
commit
f8440175f3
@ -229,6 +229,12 @@
|
|||||||
|
|
||||||
function setFormModel(key: string, value: any) {
|
function setFormModel(key: string, value: any) {
|
||||||
formModel[key] = value;
|
formModel[key] = value;
|
||||||
|
const { validateTrigger } = unref(getBindValue);
|
||||||
|
if (!validateTrigger || validateTrigger === 'change') {
|
||||||
|
try {
|
||||||
|
validateFields([key]);
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEnterPress(e: KeyboardEvent) {
|
function handleEnterPress(e: KeyboardEvent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user