Update TO form and nested components to emit directly to parent components instead of emitting from the root component
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import { emitEvent } from '../lib/emitters'
|
||||
import FormMixin from '../mixins/form'
|
||||
|
||||
export default {
|
||||
name: 'optionsinput',
|
||||
|
||||
mixins: [FormMixin],
|
||||
|
||||
props: {
|
||||
name: String,
|
||||
initialErrors: {
|
||||
@@ -48,6 +45,7 @@ export default {
|
||||
this.showValid = true
|
||||
this.value = e.target.value
|
||||
|
||||
this.$parent.$emit('field-change')
|
||||
emitEvent('field-change', this, {
|
||||
value: e.target.value,
|
||||
name: this.name,
|
||||
@@ -60,4 +58,10 @@ export default {
|
||||
return this.optional || value !== this.nullOption
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
valid: function() {
|
||||
return this._isValid(this.value)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user