Fix
This commit is contained in:
@@ -7,6 +7,7 @@ const props = defineProps<{
|
||||
type?: any; // [TOP_NAVIGATION, BOTTOM_NAVIGATION]
|
||||
}>();
|
||||
|
||||
const contentParse = computed(() => (currentPage.value.content ? JSON.parse(currentPage.value.content) : {}));
|
||||
const defineTypeRecusive = {
|
||||
TOP_NAVIGATION: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['TOP']}`]['NAVIGATION_TOP_DEFAULT'],
|
||||
BOTTOM_NAVIGATION: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['BOTTOM']}`]['NAVIGATION_BOTTOM_DEFAULT'],
|
||||
@@ -16,14 +17,22 @@ const findDataPosition = computed<any>(() => {
|
||||
let result = {};
|
||||
switch (props.type) {
|
||||
case defineTypeRecusive.TOP_NAVIGATION:
|
||||
result = currentPage.value.components && currentPage.value.components.find((component: any) => {
|
||||
return component.taxonomy === enumPageComponentKey.NAVIGATION && component.settings?.layout === defineTypeRecusive.TOP_NAVIGATION
|
||||
});
|
||||
if (contentParse.value.navigationTop) {
|
||||
result =
|
||||
currentPage.value.components &&
|
||||
currentPage.value.components.find((component: any) => {
|
||||
return component.id === contentParse.value.navigationTop;
|
||||
});
|
||||
}
|
||||
break;
|
||||
case defineTypeRecusive.BOTTOM_NAVIGATION:
|
||||
result = currentPage.value.components && currentPage.value.components.find((component: any) => {
|
||||
return component.taxonomy === enumPageComponentKey.NAVIGATION && component.settings?.layout === defineTypeRecusive.BOTTOM_NAVIGATION
|
||||
});
|
||||
if (contentParse.value.navigationBottom) {
|
||||
result =
|
||||
currentPage.value.components &&
|
||||
currentPage.value.components.find((component: any) => {
|
||||
return component.id === contentParse.value.navigationBottom;
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
result = {};
|
||||
|
||||
Reference in New Issue
Block a user