thainv-dev
This commit is contained in:
@@ -10,7 +10,7 @@ const _props = defineProps<{
|
||||
}>();
|
||||
|
||||
const definedDynamicSection: Record<string, any> = {
|
||||
[enumPageSectionTemplate[enumPageSectionKey.ARTICLE]['DEFAULT']]: Article_Section_Default,
|
||||
[`${enumPageSectionTemplate[enumPageSectionKey.ARTICLE]["DEFAULT"]}`]: Article_Section_Default,
|
||||
[`${enumPageSectionTemplate[enumPageSectionKey.ARTICLE]["DETAIL"]}`]: Article_Detail,
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Misses_Section } from './misses/index.vue'
|
||||
@@ -0,0 +1,42 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PageSection } from "@/server/models/dynamic-page/index";
|
||||
|
||||
import { enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
|
||||
import { Misses_Section } from "./index";
|
||||
|
||||
const _props = defineProps<{
|
||||
settings?: any;
|
||||
content?: any;
|
||||
section: PageSection;
|
||||
}>();
|
||||
|
||||
const definedDynamicSection: Record<string, any> = {
|
||||
[enumPageSectionTemplate[enumPageSectionKey.CATEGORY]['MISSES']]: Misses_Section,
|
||||
};
|
||||
|
||||
const getCurrentSection = computed(() => _props.settings.template);
|
||||
|
||||
const GET_PROPS = computed(() => {
|
||||
return () => {
|
||||
let props: any = {};
|
||||
if (_props.settings) {
|
||||
for (const [key, value] of Object.entries(_props.settings)) {
|
||||
props = {
|
||||
...props,
|
||||
[key]: value,
|
||||
};
|
||||
}
|
||||
}
|
||||
return props;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component
|
||||
:is="definedDynamicSection[getCurrentSection]"
|
||||
v-bind="{ ...GET_PROPS(), section: _props.section, content: _props.content, settings: _props.settings }"
|
||||
>
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
@@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import DynamicLayout from '@/components/dynamic-page/page-section/layouts/index.vue';
|
||||
import type { PageSection } from "@/server/models/dynamic-page/index";
|
||||
|
||||
const emit = defineEmits(["dropComponent", "dropData", "selectComponent"]);
|
||||
|
||||
const props = defineProps<{
|
||||
label?: any;
|
||||
layout?: string;
|
||||
settings?: any;
|
||||
content?: any;
|
||||
section: PageSection;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
<img class="w-full " src="~/assets/images/tienphong/MissCategory.png" alt="">
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<template v-if="props.layout">
|
||||
<DynamicLayout
|
||||
:layout="props.layout"
|
||||
:content="props.content"
|
||||
:settings="props.settings"
|
||||
:section="props.section"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.border-custom {
|
||||
border-color: #e5e5e5 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Default } from './Default.vue'
|
||||
@@ -0,0 +1,39 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PageSection } from "@/server/models/dynamic-page/index";
|
||||
|
||||
import { enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
|
||||
import { Default } from "./index";
|
||||
|
||||
const _props = defineProps<{
|
||||
settings?: any;
|
||||
content?: any;
|
||||
section: PageSection;
|
||||
}>();
|
||||
|
||||
const definedDynamicSection: Record<string, any> = {
|
||||
[enumPageSectionTemplate[enumPageSectionKey.CATEGORY]['MISSES']]: Default,
|
||||
};
|
||||
|
||||
const getCurrentSection = computed(() => _props.settings.template);
|
||||
|
||||
const GET_PROPS = computed(() => {
|
||||
return () => {
|
||||
let props: any = {};
|
||||
if (_props.settings) {
|
||||
for (const [key, value] of Object.entries(_props.settings)) {
|
||||
props = {
|
||||
...props,
|
||||
[key]: value,
|
||||
};
|
||||
}
|
||||
}
|
||||
return props;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="definedDynamicSection[getCurrentSection]" v-bind="{ ...GET_PROPS(), section: _props.section, content: _props.content, settings: _props.settings }">
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
@@ -1,3 +1,3 @@
|
||||
export { default as None_Section } from './none/index.vue'
|
||||
export { default as Section__ } from './sections/index.vue'
|
||||
export { default as Category_Section } from './category/index.vue'
|
||||
export { default as Article_Section } from './articles/index.vue'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PageSection } from "@/server/models/dynamic-page/index";
|
||||
import { enumPageSectionKey } from "@/definitions/enum";
|
||||
import { None_Section,Section__, Article_Section } from "./index";
|
||||
import { None_Section,Category_Section, Article_Section } from "./index";
|
||||
|
||||
const _props = defineProps<{
|
||||
settings?: any;
|
||||
@@ -11,7 +11,7 @@ const _props = defineProps<{
|
||||
|
||||
const definedDynamicSection: Record<string, any> = {
|
||||
[enumPageSectionKey.NONE]: None_Section,
|
||||
[enumPageSectionKey.SECTION]: Section__,
|
||||
[enumPageSectionKey.CATEGORY]: Category_Section,
|
||||
[enumPageSectionKey.ARTICLE]: Article_Section,
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ const _props = defineProps<{
|
||||
}>();
|
||||
|
||||
const definedDynamicSection: Record<string, any> = {
|
||||
[enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISSES']]: Misses_Section,
|
||||
// [enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISSES']]: Misses_Section,
|
||||
};
|
||||
|
||||
const getCurrentSection = computed(() => _props.settings.template);
|
||||
|
||||
@@ -11,7 +11,7 @@ const _props = defineProps<{
|
||||
}>();
|
||||
|
||||
const definedDynamicSection: Record<string, any> = {
|
||||
[enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISS']['DEFAULT']]: Default,
|
||||
// [enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISS']['DEFAULT']]: Default,
|
||||
};
|
||||
|
||||
const getCurrentSection = computed(() => _props.settings.template);
|
||||
|
||||
Reference in New Issue
Block a user