762 Fix button-wrapper functionality
This commit is contained in:
parent
ace997bbf5
commit
42fdd8aa46
2 changed files with 19 additions and 5 deletions
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<button-question
|
||||
questionText="This is a question?"
|
||||
:answers="sampleAnswers"
|
||||
:answers="sampleCheckboxAnswers"
|
||||
:isMultiSelect="true"
|
||||
groupName="multiselect-test"
|
||||
v-model="selectedMultiselectValues"
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<button-question
|
||||
questionText="This is another question?"
|
||||
:answers="sampleAnswers"
|
||||
:answers="sampleRadioAnswers"
|
||||
:isMultiSelect="false"
|
||||
groupName="radio-test"
|
||||
v-model="selectedRadioValue"
|
||||
|
|
@ -51,7 +51,21 @@ export default {
|
|||
name: "test",
|
||||
data() {
|
||||
return {
|
||||
sampleAnswers: [
|
||||
sampleCheckboxAnswers: [
|
||||
{
|
||||
Text: "Part 1",
|
||||
Name: "PART1",
|
||||
},
|
||||
{
|
||||
Text: "Part 2",
|
||||
Name: "PART2",
|
||||
},
|
||||
{
|
||||
Text: "Part 3",
|
||||
Name: "PART3",
|
||||
},
|
||||
],
|
||||
sampleRadioAnswers: [
|
||||
{
|
||||
Text: "Part 1",
|
||||
Name: "PART1",
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export default {
|
|||
|
||||
valueToEmit = newValue;
|
||||
} else {
|
||||
valueToEmit = isChecked;
|
||||
valueToEmit = this.value;
|
||||
}
|
||||
|
||||
console.log("ButtonWrapper is emitting: ", valueToEmit);
|
||||
|
|
@ -76,7 +76,7 @@ export default {
|
|||
return this.isMultiSelect ? "checkbox" : "radio";
|
||||
},
|
||||
buttonId() {
|
||||
return JSON.stringify(this.value);
|
||||
return `${this.groupName} ${JSON.stringify(this.value)}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue