46 lines
973 B
Vue
46 lines
973 B
Vue
<template>
|
|
<buttonQuestion class="radioQuestion"
|
|
:questionText="questionText"
|
|
:answers="years"
|
|
groupName="Choose Vehicle Year"
|
|
v-model="selectedYear"
|
|
/>
|
|
</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: "year-question",
|
|
data() {
|
|
return {
|
|
questionText: null,
|
|
selectedYear: null,
|
|
years: Array,
|
|
}
|
|
},
|
|
props: {
|
|
modelValue: String,
|
|
},
|
|
components: {
|
|
buttonQuestion,
|
|
},
|
|
methods: {
|
|
loadInitialData() {
|
|
return store.dispatch(storeActions.GET_VEHICLE_YEARS, {});
|
|
},
|
|
initializeComponent(cmsContent, initialData) {
|
|
this.questionText = cmsContent.QuestionText;
|
|
this.years = initialData;
|
|
}
|
|
},
|
|
watch: {
|
|
selectedYear(val) {
|
|
this.$emit("update:modelValue", val);
|
|
}
|
|
},
|
|
};
|
|
</script>
|