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
}
},
}
}

View File

@@ -7,6 +7,7 @@ import textinput from './components/text_input'
import checkboxinput from './components/checkbox_input'
import DetailsOfUse from './components/forms/details_of_use'
import poc from './components/forms/poc'
import financial from './components/forms/financial'
Vue.use(VTooltip)
@@ -19,6 +20,7 @@ const app = new Vue({
checkboxinput,
DetailsOfUse,
poc,
financial,
},
methods: {
closeModal: function(name) {