Remove old field-mount and field-change emitters and listeners.

Replace FormMixin with new functionality.
This commit is contained in:
leigh-mil
2019-11-13 15:59:43 -05:00
parent 3576551f42
commit bc0382834b
9 changed files with 21 additions and 176 deletions

View File

@@ -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) {