Funding type other input is only required if funding type is other
This commit is contained in:
41
js/components/forms/financial.js
Normal file
41
js/components/forms/financial.js
Normal 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
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user