Browse Source

fix: checkbox set additional attribute no work,close #5678 (#5682)

pull/5685/head
wengjq 2 years ago committed by GitHub
parent
commit
87db9bd87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      components/vc-checkbox/Checkbox.tsx

5
components/vc-checkbox/Checkbox.tsx

@ -113,9 +113,10 @@ export default defineComponent({
onKeypress, onKeypress,
onKeyup, onKeyup,
} = attrs as HTMLAttributes; } = 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') { if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {
prev[key] = others[key]; prev[key] = othersAndAttrs[key];
} }
return prev; return prev;
}, {}); }, {});

Loading…
Cancel
Save