Add mounted event emitter to checkbox input and send whether or not the field is valid on field-change
This commit is contained in:
parent
72d274c1f8
commit
04d6672c0c
@ -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,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user