DigitalConsumer.FixMyGlass/src/layouts/vehicle-style/style-question/style-question.vue
2021-12-21 10:53:27 -05:00

46 lines
1.1 KiB
Vue

<template>
<buttonQuestion class="radioQuestion"
:questionText="questionText"
:answers="styles"
groupName="Choose Vehicle Style"
v-model="selectedStyle"
/>
</template>
<script>
import buttonQuestion from "@/common-components/button-question/button-question";
// Supporting files
import store from "@/store";
import { storeActions } from "@/constants/store-actions.js";
export default {
name: "style-question",
data() {
return {
questionText: null,
selectedStyle: null,
styles: Array,
}
},
props: {
modelValue: String,
},
components: {
buttonQuestion,
},
methods: {
loadInitialData() {
return store.dispatch(storeActions.GET_VEHICLE_STYLES, {year: store.getters.vehicle.year, make: encodeURIComponent(store.getters.vehicle.make), model: encodeURIComponent(store.getters.vehicle.model)});
},
initializeComponent(cmsContent, initialData) {
this.questionText = cmsContent.QuestionText;
this.styles = initialData;
}
},
watch: {
selectedStyle(val) {
this.$emit("update:modelValue", val);
}
},
};
</script>