Skip to content

Commit 87db9bd

Browse files
authored
fix: checkbox set additional attribute no work,close #5678 (#5682)
1 parent fef42fd commit 87db9bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/vc-checkbox/Checkbox.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ export default defineComponent({
113113
onKeypress,
114114
onKeyup,
115115
} = attrs as HTMLAttributes;
116-
const globalProps = Object.keys({ ...others, ...attrs }).reduce((prev, key) => {
116+
const othersAndAttrs = { ...others, ...attrs };
117+
const globalProps = Object.keys(othersAndAttrs).reduce((prev, key) => {
117118
if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {
118-
prev[key] = others[key];
119+
prev[key] = othersAndAttrs[key];
119120
}
120121
return prev;
121122
}, {});

0 commit comments

Comments
 (0)