Commit 513823bfbd3e8acc68098e0708c34bff2dd8dba6
1 parent
d683b0f1
fix(form): loss args on component change event
修复部分组件的change事件不止一个参数时,componentProps中配置的onChange只能接收到第一个参数的问题
Showing
1 changed file
with
3 additions
and
2 deletions
src/components/Form/src/components/FormItem.vue
... | ... | @@ -225,9 +225,10 @@ |
225 | 225 | const eventKey = `on${upperFirst(changeEvent)}`; |
226 | 226 | |
227 | 227 | const on = { |
228 | - [eventKey]: (e: Nullable<Recordable>) => { | |
228 | + [eventKey]: (...args: Nullable<Recordable>[]) => { | |
229 | + const [e] = args; | |
229 | 230 | if (propsData[eventKey]) { |
230 | - propsData[eventKey](e); | |
231 | + propsData[eventKey](...args); | |
231 | 232 | } |
232 | 233 | const target = e ? e.target : null; |
233 | 234 | const value = target ? (isCheck ? target.checked : target.value) : e; | ... | ... |