diff --git a/src/form/checkbox.js b/src/form/checkbox.js index 7dec373..caff6fe 100644 --- a/src/form/checkbox.js +++ b/src/form/checkbox.js @@ -37,6 +37,7 @@ class Checkbox extends Component { } else { this.value.push(ev.value) } + this.$emit('input', { data: this.value }) this.$emit('change', { data: this.value }) }) @@ -211,7 +212,7 @@ class CheckboxItem extends Component { ` ] - toggleCheck(ev) { + #toggleCheck(ev) { if (this.disabled || this.readOnly) { return } @@ -227,13 +228,14 @@ class CheckboxItem extends Component { if (this.inGroup) { this.parentNode.$emit('child-change', data) } else { + this.$emit('input', data) this.$emit('change', data) } } - handleClick(ev) { + #click(ev) { if (ev.type === 'click' || ev.keyCode === 32) { - this.toggleCheck(ev) + this.#toggleCheck(ev) } } @@ -246,8 +248,8 @@ class CheckboxItem extends Component { render() { return html`