From 04d6672c0c80140a116dbecab9664f4a7bceb12f Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Wed, 17 Jul 2019 10:09:00 -0400 Subject: [PATCH] Add mounted event emitter to checkbox input and send whether or not the field is valid on field-change --- js/components/checkbox_input.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/components/checkbox_input.js b/js/components/checkbox_input.js index db542fef..9236caf8 100644 --- a/js/components/checkbox_input.js +++ b/js/components/checkbox_input.js @@ -19,11 +19,20 @@ export default { } }, + created: function() { + emitEvent('field-mount', this, { + optional: this.optional, + name: this.name, + valid: this.isChecked, + }) + }, + methods: { onInput: function(e) { emitEvent('field-change', this, { value: e.target.checked, name: this.name, + valid: this.isChecked, }) }, },