atst/js/mixins/form.js
2018-08-23 16:51:09 -04:00

15 lines
291 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
}
},
}
}