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: 'optionsinput',
|
||||
|
||||
@@ -21,11 +23,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput: function(e) {
|
||||
this.$root.$emit('field-change', {
|
||||
value: e.target.value,
|
||||
name: this.name,
|
||||
parent_uid: this.$parent._uid,
|
||||
})
|
||||
emitFieldChange(this, { value: e.target.value, name: this.name })
|
||||
this.showError = false
|
||||
this.showValid = true
|
||||
},
|
||||
|
Reference in New Issue
Block a user