Update vue and template to add multiple LOAs
This commit is contained in:
@@ -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
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@@ -34,8 +34,8 @@ export default {
|
||||
|
||||
methods: {
|
||||
addClin: function(event) {
|
||||
this.clins = this.clins + 1
|
||||
this.clinIndex = this.clinIndex + 1
|
||||
++this.clins
|
||||
++this.clinIndex
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user