Create KoReview component to add multiple LOA items
This commit is contained in:
40
js/components/forms/ko_review.js
Normal file
40
js/components/forms/ko_review.js
Normal 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(''))
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user