fix(BasicForm->FormItem): model should update before event call (#3573). resolve #3570

This commit is contained in:
xachary 2024-01-24 17:10:36 +08:00 committed by GitHub
parent 778ebe1f44
commit 43aa743032
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -280,12 +280,14 @@
const on = {
[eventKey]: (...args: Nullable<Recordable<any>>[]) => {
const [e] = args;
if (propsData[eventKey]) {
propsData[eventKey](...args);
}
const target = e ? e.target : null;
const value = target ? (isCheck ? target.checked : target.value) : e;
props.setFormModel(field, value, props.schema);
if (propsData[eventKey]) {
propsData[eventKey](...args);
}
},
};
const Comp = componentMap.get(component) as ReturnType<typeof defineComponent>;