Refactor emit field change into a utility function
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { emitFieldChange } from '../lib/emitters'
|
||||
|
||||
export default {
|
||||
name: 'checkboxinput',
|
||||
|
||||
@@ -7,11 +9,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput: function(e) {
|
||||
this.$root.$emit('field-change', {
|
||||
value: e.target.checked,
|
||||
name: this.name,
|
||||
parent_uid: this.$parent._uid,
|
||||
})
|
||||
emitFieldChange(this, { value: e.target.checked, name: this.name })
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user