atst/js/mixins/form.js
2019-01-24 09:38:43 -05:00

15 lines
290 B
JavaScript

export default {
mounted: function() {
this.$root.$on('field-change', this.handleFieldChange)
},
methods: {
handleFieldChange: function(event) {
const { value, name } = event
if (typeof this[name] !== undefined) {
this[name] = value
}
},
},
}