Create KoReview component to add multiple LOA items

This commit is contained in:
leigh-mil
2019-02-18 16:52:18 -05:00
parent 070ccec23f
commit 3325e4c219
6 changed files with 188 additions and 37 deletions

View File

@@ -0,0 +1,40 @@
import textinput from '../text_input'
import DateSelector from '../date_selector'
import uploadinput from '../upload_input'
import inputValidations from '../../lib/input_validations'
const createLOA = number => ({ number })
export default {
name: 'ko-review',
components: {
textinput,
DateSelector,
uploadinput,
},
props: {
initialData: {
type: Object,
default: () => ({}),
},
modalName: String,
},
data: function() {
const { loa } = this.initialData
const loas =
typeof loa === 'array' && loa.length > 0 ? this.initialValue : ['']
return {
loas,
}
},
methods: {
addLOA: function(event) {
this.loas.push(createLOA(''))
},
},
}