Fix template and component so LOA values are posted through the form
This commit is contained in:
parent
f9b379c2f1
commit
68ab32d1d1
@ -2,12 +2,15 @@ import textinput from '../text_input'
|
|||||||
import DateSelector from '../date_selector'
|
import DateSelector from '../date_selector'
|
||||||
import uploadinput from '../upload_input'
|
import uploadinput from '../upload_input'
|
||||||
import inputValidations from '../../lib/input_validations'
|
import inputValidations from '../../lib/input_validations'
|
||||||
|
import FormMixin from '../../mixins/form'
|
||||||
|
|
||||||
const createLOA = number => ({ number })
|
const createLOA = number => ({ number })
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ko-review',
|
name: 'ko-review',
|
||||||
|
|
||||||
|
mixins: [FormMixin],
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
textinput,
|
textinput,
|
||||||
DateSelector,
|
DateSelector,
|
||||||
@ -23,15 +26,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
const { loa } = this.initialData
|
const loa_list = this.initialData['loa']
|
||||||
const loas =
|
const loas = (loa_list.length > 0 ? loa_list : ['']).map(createLOA)
|
||||||
typeof loa === 'array' && loa.length > 0 ? this.initialValue : ['']
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
loas,
|
loas,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted: function() {
|
||||||
|
this.$root.$on('onLOAAdded', this.addLOA)
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
addLOA: function(event) {
|
addLOA: function(event) {
|
||||||
this.loas.push(createLOA(''))
|
this.loas.push(createLOA(''))
|
||||||
|
@ -101,8 +101,8 @@
|
|||||||
<label :for="'loa-' + i">
|
<label :for="'loa-' + i">
|
||||||
<div class="usa-input__title">Line of Accounting (LOA) #</div>
|
<div class="usa-input__title">Line of Accounting (LOA) #</div>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" :id="'loa-' + i" placeholder="1234567890"/>
|
<input type="text" v-model='loa.number' :id="'loa-' + i" placeholder="1234567890"/>
|
||||||
<input type="hidden" :name="'loa-' + i"/>
|
<input type="hidden" :name="'loa-' + i" v-model='loa.number'/>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user