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(''))
},
},
}

View File

@@ -31,6 +31,7 @@ import ConfirmationPopover from './components/confirmation_popover'
import { isNotInVerticalViewport } from './lib/viewport'
import DateSelector from './components/date_selector'
import SidenavToggler from './components/sidenav_toggler'
import KoReview from './components/forms/ko_review'
Vue.config.productionTip = false
@@ -64,6 +65,7 @@ const app = new Vue({
DateSelector,
EditOfficerForm,
SidenavToggler,
KoReview,
},
mounted: function() {