Merge pull request #187 from Safelite/feature/CSR-268_cleanup
changing check change method to take specific value
This commit is contained in:
commit
ba9cd0a075
1 changed files with 3 additions and 2 deletions
|
|
@ -108,13 +108,14 @@ export default {
|
|||
if(Array.isArray(this.answers) && this.answers.length === 1) {
|
||||
this.modelValueAnswers.push(typeof(this.answers[0]) === 'object' ? this.answers[0].Name : this.answers[0]);
|
||||
this.$emit("update:modelValue", this.modelValueAnswers);
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCheckedChanged(val) {
|
||||
// Add or remove item to array of data to emit
|
||||
val.isChecked ? this.modelValueAnswers.push(val.buttonId) : this.modelValueAnswers.splice(this.modelValueAnswers.indexOf(val.buttonId), 1);
|
||||
this.$emit("update:modelValue", this.modelValueAnswers.length ? this.modelValueAnswers : undefined);
|
||||
const answersToEmit = this.modelValueAnswers.length ? this.modelValueAnswers : undefined;
|
||||
this.$emit("update:modelValue", answersToEmit);
|
||||
},
|
||||
},
|
||||
components: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue