Refactor emit field change into a utility function

This commit is contained in:
leigh-mil
2019-04-04 10:31:02 -04:00
parent 1aaf4421ab
commit 3f2beb44b2
6 changed files with 18 additions and 22 deletions

View File

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