Add emiter to all input fields

This commit is contained in:
leigh-mil 2019-04-02 15:38:46 -04:00
parent 8b10732ac9
commit 02cc18a93f
6 changed files with 12 additions and 2 deletions

View File

@ -10,6 +10,7 @@ export default {
this.$root.$emit('field-change', { this.$root.$emit('field-change', {
value: e.target.checked, value: e.target.checked,
name: this.name, name: this.name,
parent_uid: this.$parent._uid,
}) })
}, },
}, },

View File

@ -135,7 +135,11 @@ export default {
methods: { methods: {
_emitChange: function(name, value, valid) { _emitChange: function(name, value, valid) {
this.$root.$emit('field-change', { value, valid, name }) this.$root.$emit('field-change', {
value,
name,
parent_uid: this.$parent && this.$parent._uid,
})
}, },
}, },

View File

@ -43,6 +43,7 @@ export default {
this.$root.$emit('field-change', { this.$root.$emit('field-change', {
value: e.target.value, value: e.target.value,
name: this.name, name: this.name,
parent_uid: this.$parent._uid,
}) })
this.showError = false this.showError = false
this.showValid = true this.showValid = true

View File

@ -24,6 +24,7 @@ export default {
this.$root.$emit('field-change', { this.$root.$emit('field-change', {
value: e.target.value, value: e.target.value,
name: this.name, name: this.name,
parent_uid: this.$parent._uid,
}) })
this.showError = false this.showError = false
this.showValid = true this.showValid = true

View File

@ -128,6 +128,7 @@ export default {
value: this._rawValue(value), value: this._rawValue(value),
valid, valid,
name: this.name, name: this.name,
parent_uid: this.$parent._uid,
}) })
}, },

View File

@ -10,7 +10,9 @@ export default {
const { value, name } = event const { value, name } = event
if (typeof this[name] !== undefined) { if (typeof this[name] !== undefined) {
this[name] = value this[name] = value
this.disabled = false if (event['parent_uid'] === this._uid) {
this.disabled = false
}
} }
}, },
}, },