Remove old field-mount and field-change emitters and listeners.
Replace FormMixin with new functionality.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { emitEvent } from '../lib/emitters'
|
||||
|
||||
export default {
|
||||
name: 'optionsinput',
|
||||
|
||||
@@ -21,14 +19,6 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
created: function() {
|
||||
emitEvent('field-mount', this, {
|
||||
optional: this.optional,
|
||||
name: this.name,
|
||||
valid: this._isValid(this.value),
|
||||
})
|
||||
},
|
||||
|
||||
data: function() {
|
||||
const showError = (this.initialErrors && this.initialErrors.length) || false
|
||||
return {
|
||||
@@ -40,18 +30,8 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
onInput: function(e) {
|
||||
this.showError = false
|
||||
this.showValid = true
|
||||
this.value = e.target.value
|
||||
|
||||
onInput: function() {
|
||||
this.$parent.$emit('field-change')
|
||||
emitEvent('field-change', this, {
|
||||
value: e.target.value,
|
||||
name: this.name,
|
||||
watch: this.watch,
|
||||
valid: this._isValid(e.target.value),
|
||||
})
|
||||
},
|
||||
|
||||
_isValid: function(value) {
|
||||
|
Reference in New Issue
Block a user