From 513823bfbd3e8acc68098e0708c34bff2dd8dba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Thu, 17 Jun 2021 17:34:11 +0800 Subject: [PATCH] fix(form): loss args on component change event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复部分组件的change事件不止一个参数时,componentProps中配置的onChange只能接收到第一个参数的问题 --- src/components/Form/src/components/FormItem.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Form/src/components/FormItem.vue b/src/components/Form/src/components/FormItem.vue index 9ce1ccf2..c8adf9e3 100644 --- a/src/components/Form/src/components/FormItem.vue +++ b/src/components/Form/src/components/FormItem.vue @@ -225,9 +225,10 @@ const eventKey = `on${upperFirst(changeEvent)}`; const on = { - [eventKey]: (e: Nullable) => { + [eventKey]: (...args: Nullable[]) => { + const [e] = args; if (propsData[eventKey]) { - propsData[eventKey](e); + propsData[eventKey](...args); } const target = e ? e.target : null; const value = target ? (isCheck ? target.checked : target.value) : e; -- GitLab