fix(checkbox): onClick event triggered twice (#5363)

Co-authored-by: 张宏亮 <hongliang@yunshan.net>
This commit is contained in:
Arron 2022-03-20 10:03:28 +08:00 committed by GitHub
parent 17acda5655
commit 47e218d7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,7 @@ export default defineComponent({
id,
prefixCls: prefixCls.value,
...restAttrs,
onClick,
};
if (checkboxGroup && !skipGroup) {
checkboxProps.onChange = (...args) => {
@ -103,7 +104,6 @@ export default defineComponent({
style={style}
onMouseenter={onMouseenter as EventHandler}
onMouseleave={onMouseleave as EventHandler}
onClick={onClick}
>
<VcCheckbox {...checkboxProps} class={checkboxClass} ref={checkboxRef} />
{children.length ? <span>{children}</span> : null}