From 87db9bd87d97584572f5021c81d8d4093630e07f Mon Sep 17 00:00:00 2001 From: wengjq <2410808055@qq.com> Date: Wed, 8 Jun 2022 15:59:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20checkbox=20set=20additional=20attribute?= =?UTF-8?q?=20no=20work=EF=BC=8Cclose=20#5678=20(#5682)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/vc-checkbox/Checkbox.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/vc-checkbox/Checkbox.tsx b/components/vc-checkbox/Checkbox.tsx index a8b7ea89a..0220c58c0 100644 --- a/components/vc-checkbox/Checkbox.tsx +++ b/components/vc-checkbox/Checkbox.tsx @@ -113,9 +113,10 @@ export default defineComponent({ onKeypress, onKeyup, } = attrs as HTMLAttributes; - const globalProps = Object.keys({ ...others, ...attrs }).reduce((prev, key) => { + const othersAndAttrs = { ...others, ...attrs }; + const globalProps = Object.keys(othersAndAttrs).reduce((prev, key) => { if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') { - prev[key] = others[key]; + prev[key] = othersAndAttrs[key]; } return prev; }, {});