minhnt-dev: fix page template
This commit is contained in:
@@ -1,46 +1,37 @@
|
||||
<script lang="ts" setup>
|
||||
import { layouts } from "@/definitions/enum";
|
||||
|
||||
import {
|
||||
BASE_LAYOUT,
|
||||
ARTICLE_SHORT_LAYOUT,
|
||||
ARTICLE_PAGE_LAYOUT,
|
||||
ARTICLE_NORMAL_LAYOUT,
|
||||
ARTICLE_NONE_LAYOUT,
|
||||
ARTICLE_LONG_LAYOUT,
|
||||
} from './index';
|
||||
import { enumPageKey, enumPageTemplate, enumPageLayouts } from "@/definitions/enum";
|
||||
import { Home_Default, ARTICLE_LONG_LAYOUT, ARTICLE_NONE_LAYOUT, ARTICLE_NORMAL_LAYOUT, ARTICLE_PAGE_LAYOUT, ARTICLE_SHORT_LAYOUT } from "./index";
|
||||
|
||||
const _props = defineProps<{
|
||||
settings?: any,
|
||||
}>()
|
||||
settings?: any;
|
||||
}>();
|
||||
|
||||
const definedDynamicPageLayout: Record<string, any> = {
|
||||
'Default': BASE_LAYOUT,
|
||||
[layouts.FULL_PAGE]: BASE_LAYOUT,
|
||||
[layouts.CENTER_PAGE]: BASE_LAYOUT,
|
||||
[layouts.BACKGROUND_PAGE]: BASE_LAYOUT,
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.HOME]["DEFAULT"]]["DEFAULT"]]: Home_Default,
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.HOME]["DEFAULT"]]["FULL"]]: Home_Default,
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.HOME]["DEFAULT"]]["BACKGROUND_PAGE"]]: Home_Default,
|
||||
|
||||
'ARTICLE_SHORT': ARTICLE_SHORT_LAYOUT,
|
||||
'ARTICLE_PAGE': ARTICLE_PAGE_LAYOUT,
|
||||
'ARTICLE_NORMAL': ARTICLE_NORMAL_LAYOUT,
|
||||
'ARTICLE_NONE': ARTICLE_NONE_LAYOUT,
|
||||
'ARTICLE_LONG': ARTICLE_LONG_LAYOUT,
|
||||
}
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_SHORT"]]: ARTICLE_SHORT_LAYOUT,
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_PAGE"]]: ARTICLE_PAGE_LAYOUT,
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_NORMAL"]]: ARTICLE_NORMAL_LAYOUT,
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_NONE"]]: ARTICLE_NONE_LAYOUT,
|
||||
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_LONG"]]: ARTICLE_LONG_LAYOUT,
|
||||
};
|
||||
|
||||
const getCurrentLayout = computed(() => _props.settings.layout);
|
||||
const getCurrentLayout = computed(() => _props.settings?.layout);
|
||||
|
||||
const GET_PROPS = computed(() => {
|
||||
return () => {
|
||||
let props: any = {};
|
||||
for (const [key, value] of Object.entries(_props.settings)) {
|
||||
props = {
|
||||
...props,
|
||||
[key]: value
|
||||
}
|
||||
}
|
||||
return props;
|
||||
};
|
||||
})
|
||||
return () => {
|
||||
let props: any = {};
|
||||
for (const [key, value] of Object.entries(_props.settings)) {
|
||||
props = {
|
||||
...props,
|
||||
[key]: value,
|
||||
};
|
||||
}
|
||||
return props;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user