Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit b39106f

Browse files
committed
fix(checkbox): added back onCheck event
1 parent d7bcc3c commit b39106f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/components/checkbox-input/CheckboxInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineComponent({
1111
name: 'asCheckboxInput',
1212
props,
1313
setup(props, { emit }) {
14-
const { onChange, onFocus, onBlur } = useInputEvents(props, emit);
14+
const { onCheck, onFocus, onBlur } = useInputEvents(props, emit);
1515
const renderCheckbox = [
1616
h('input', {
1717
name: props?.control?.name || '',
@@ -23,7 +23,7 @@ export default defineComponent({
2323
checked: props?.control?.value,
2424
onFocus,
2525
onBlur,
26-
onChange,
26+
onChange: onCheck,
2727
}),
2828
h(
2929
'label',

src/composables/input-events.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ export function useInputEvents(props: any, emit: any) {
1010

1111
emit('change', {
1212
name: props.control.name,
13-
value: props.control.type === 'checkbox'
14-
? $event.target.checked
15-
: $event.target.value,
13+
value: $event.target.value
1614
});
1715
}
1816
}

0 commit comments

Comments
 (0)