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; }, {});