Add mounted event emitter to checkbox input and send whether or not the field is valid on field-change

This commit is contained in:
leigh-mil 2019-07-17 10:09:00 -04:00
parent 72d274c1f8
commit 04d6672c0c

View File

@ -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,
})
},
},