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