Update vue and template to add multiple LOAs

This commit is contained in:
leigh-mil
2019-06-10 12:16:05 -04:00
parent 62c794e7b8
commit e9c21b0d5e
3 changed files with 89 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
import DateSelector from './date_selector'
import optionsinput from './options_input'
import textinput from './text_input'
export default {
@@ -6,14 +7,36 @@ export default {
components: {
DateSelector,
optionsinput,
textinput,
},
props: {
initialClinIndex: Number,
initialLoaCount: {
type: Number,
default: 0,
},
},
data: function() {
return { clinIndex: this.initialClinIndex }
const loas = this.initialLoaCount == 0 ? 1 : 0
const indexOffset = this.initialLoaCount
return {
clinIndex: this.initialClinIndex,
indexOffset: this.initialLoaCount,
loas: loas,
}
},
methods: {
addLoa: function(event) {
++this.loas
},
loaIndex: function(index) {
return index + this.indexOffset - 1
},
},
}

View File

@@ -34,8 +34,8 @@ export default {
methods: {
addClin: function(event) {
this.clins = this.clins + 1
this.clinIndex = this.clinIndex + 1
++this.clins
++this.clinIndex
},
},
}