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

This commit is contained in:
wengjq 2022-06-08 15:59:21 +08:00 committed by GitHub
parent fef42fd089
commit 87db9bd87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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