Browse Source

fix(form): loss args on component change event

修复部分组件的change事件不止一个参数时,componentProps中配置的onChange只能接收到第一个参数的问题
pull/792/head
无木 5 years ago
parent
commit
513823bfbd
  1. 5
      src/components/Form/src/components/FormItem.vue

5
src/components/Form/src/components/FormItem.vue

@ -225,9 +225,10 @@
const eventKey = `on${upperFirst(changeEvent)}`; const eventKey = `on${upperFirst(changeEvent)}`;
const on = { const on = {
[eventKey]: (e: Nullable<Recordable>) => { [eventKey]: (...args: Nullable<Recordable>[]) => {
const [e] = args;
if (propsData[eventKey]) { if (propsData[eventKey]) {
propsData[eventKey](e); propsData[eventKey](...args);
} }
const target = e ? e.target : null; const target = e ? e.target : null;
const value = target ? (isCheck ? target.checked : target.value) : e; const value = target ? (isCheck ? target.checked : target.value) : e;

Loading…
Cancel
Save