Added global ready variable
This commit is contained in:
parent
a5ec3b322b
commit
22beb0df5f
3 changed files with 17 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const widgetNames = {
|
||||
HEADER_TEXT_WIDGET: "HeaderTextWidget",
|
||||
PAGE_HEADER_WIDGET: "PageHeaderWidget",
|
||||
RADIO_QUESTION_WIDGET: "RadioQuestionWidget",
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div v-if="isPageReady" class="select-car">
|
||||
<template v-if="isPageReady">
|
||||
<div class="select-car">
|
||||
<div class="select-car-form rounded text-center">
|
||||
<Header :text="headerTextWidgets[0].HeaderText" class="Header" />
|
||||
<yearQuestion :questionText="radioQuestionWidgets[0].QuestionText" />
|
||||
<Header :text="pageHeaderWidgets.HeaderText" class="Header" />
|
||||
<yearQuestion :questionText="radioQuestionWidgets.QuestionText" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -15,19 +15,15 @@ export default {
|
|||
name: "vehicle-year",
|
||||
data() {
|
||||
return {
|
||||
headerTextWidgets: {},
|
||||
pageHeaderWidgets: {},
|
||||
radioQuestionWidgets: {},
|
||||
isPageReady: false,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
async created() {
|
||||
const pageContent = await this.GetContentFromCms();
|
||||
|
||||
this.headerTextWidgets = pageContent.HeaderTextWidget;
|
||||
this.radioQuestionWidgets = pageContent.RadioQuestionWidget;
|
||||
this.isPageReady = true;
|
||||
|
||||
this.pageHeaderWidgets = pageContent.PageHeaderWidget[0];
|
||||
this.radioQuestionWidgets = pageContent.RadioQuestionWidget[0];
|
||||
},
|
||||
components: {
|
||||
yearQuestion,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@ import { storeActions } from "@/constants/storeActions.js";
|
|||
import { widgetNames } from "@/constants/widgetNames.js";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
isPageReady: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dispatchBlockingStoreAction(type, payload) {
|
||||
// globalMethods.showWaitingModal(true);
|
||||
|
|
@ -34,6 +39,10 @@ export default {
|
|||
pageDataFromCms[widget.Type] = [widget.Model];
|
||||
}
|
||||
});
|
||||
|
||||
// Our 'Page' is ready because we have data now
|
||||
this.isPageReady = true;
|
||||
|
||||
return pageDataFromCms;
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue