Browse Source
fix(BasicForm->FormItem): model should update before event call (#3573). resolve #3570
pull/3575/head
xachary
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
7 deletions
-
src/components/Form/src/components/FormItem.vue
|
|
|
@ -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 ( |
|
|
|
|