Make remove CLIN button work
This commit is contained in:
@@ -62,6 +62,7 @@ export default {
|
||||
popValid: popValidation,
|
||||
showPopError: showPopValidation,
|
||||
clinNumber: clinNumber,
|
||||
showClin: true,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -77,7 +78,7 @@ export default {
|
||||
})
|
||||
emitEvent('field-mount', this, {
|
||||
optional: false,
|
||||
name: POP,
|
||||
name: POP + "-" + this.clinIndex,
|
||||
valid: this.checkPopValid(),
|
||||
})
|
||||
},
|
||||
@@ -103,7 +104,7 @@ export default {
|
||||
}
|
||||
|
||||
emitEvent('field-change', this, {
|
||||
name: POP,
|
||||
name: POP + "-" + this.clinIndex,
|
||||
valid: this.checkPopValid(),
|
||||
})
|
||||
},
|
||||
@@ -127,6 +128,13 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
removeClin: function() {
|
||||
this.showClin = false
|
||||
emitEvent('remove-clin', this, {
|
||||
clinIndex: this.clinIndex,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
@@ -56,6 +56,7 @@ export default {
|
||||
|
||||
mounted: function() {
|
||||
this.$root.$on('clin-change', this.calculateClinAmounts)
|
||||
this.$root.$on('remove-clin', this.handleRemoveClin)
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -64,10 +65,9 @@ export default {
|
||||
++this.clinIndex
|
||||
},
|
||||
|
||||
removeClin: function(clinIndex) {
|
||||
if (this.clins > 0) {
|
||||
console.log('removed CLIN')
|
||||
}
|
||||
handleRemoveClin: function(event) {
|
||||
--this.clinIndex
|
||||
console.log('removed clin')
|
||||
},
|
||||
|
||||
calculateClinAmounts: function(event) {
|
||||
|
Reference in New Issue
Block a user