Use form mixin for add field change handler
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import FormMixin from '../../mixins/form'
|
||||
import optionsinput from '../options_input'
|
||||
import textinput from '../text_input'
|
||||
|
||||
export default {
|
||||
name: 'financial',
|
||||
|
||||
mixins: [FormMixin],
|
||||
|
||||
components: {
|
||||
optionsinput,
|
||||
textinput,
|
||||
@@ -24,18 +27,5 @@ export default {
|
||||
return {
|
||||
funding_type
|
||||
}
|
||||
},
|
||||
|
||||
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
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user