CSR-731 | Allow button-question to accept component as prop

This commit is contained in:
Scott Kiener 2022-10-25 11:39:32 -04:00
parent 882def70a7
commit 6377959980
2 changed files with 16 additions and 2 deletions

View file

@ -84,7 +84,6 @@ import listButton from "@/ux-components/list-button/list-button";
import listButtonHorizontal from "@/ux-components/list-button-horizontal/list-button-horizontal";
import listCard from "@/ux-components/list-card/list-card";
import radio from "@/ux-components/radio/radio";
import servicePackageRadio from "@/layouts/quote/service-package-question/service-package-radio/service-package-radio";
import { ErrorMessage } from "vee-validate";
export default {
@ -94,6 +93,10 @@ export default {
type: String,
default: "listButton",
},
buttonTypeObject: {
type: Object,
default: null,
},
isMultiSelect: Boolean,
groupName: String,
questionText: String,
@ -123,6 +126,11 @@ export default {
valueToLogType: String,
additionalData: null
},
beforeMount() {
if (this.buttonTypeObject) {
this.$options.components[this.buttonType] = this.buttonTypeObject;
}
},
data() {
return {
lastValuePushedToGa: null,
@ -245,7 +253,6 @@ export default {
listCard,
ErrorMessage,
radio,
servicePackageRadio,
},
};
</script>

View file

@ -3,6 +3,7 @@
:answers="servicePackageAnswers"
:groupName="groupName"
buttonType="servicePackageRadio"
:buttonTypeObject="servicePackageRadio"
v-model="selectedValues"
isRequired
/>
@ -13,6 +14,7 @@ import buttonQuestion from "@/common-components/button-question/button-question"
import baseMixin from "@/mixins/base-mixin.js";
import { splitCopyOnCMSPlaceHolder, processIfStatements } from "@/helpers/cms-content-helper";
import { damageLocationsSelected as glassLocation } from "@/constants/damage-locations-selected";
import servicePackageRadio from "./service-package-radio/service-package-radio"
export default ({
name: "servicePackageQuestion",
@ -24,6 +26,11 @@ export default ({
isInsuranceSelected: Boolean,
lineItems: null,
},
data() {
return {
servicePackageRadio: servicePackageRadio,
}
},
computed: {
selectedValues: {
get: function() {