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

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>;
@@ -385,8 +387,8 @@
return slot
? getSlot(slots, slot, unref(getValues), opts)
: render
? render(unref(getValues), opts)
: renderComponent();
? render(unref(getValues), opts)
: renderComponent();
};
const showSuffix = !!suffix;
@@ -437,8 +439,8 @@
return colSlot
? getSlot(slots, colSlot, values, opts)
: renderColContent
? renderColContent(values, opts)
: renderItem();
? renderColContent(values, opts)
: renderItem();
};
return (