Funding type other input is only required if funding type is other

This commit is contained in:
richard-dds
2018-08-16 13:52:17 -04:00
parent 4a1a3571bc
commit 59b5e19c79
5 changed files with 76 additions and 8 deletions

View File

@@ -0,0 +1,41 @@
import optionsinput from '../options_input'
import textinput from '../text_input'
export default {
name: 'financial',
components: {
optionsinput,
textinput,
},
props: {
initialData: {
type: Object,
default: () => ({})
}
},
data: function () {
const {
funding_type = ""
} = this.initialData
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
}
},
}
}