thainv: ghép navigation

This commit is contained in:
nguyen van thai
2024-06-17 11:48:00 +07:00
parent c2b9208746
commit 3c75c89a8b
30 changed files with 856 additions and 108 deletions
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { enumPageComponentTemplates } from "@/definitions/enum";
import { Dynamic_Section, Dynamic_Category, Dynamic_Collection, CollectionPaging, Dynamic_Other, Dynamic_Advertising, Dynamic_Article } from "./index";
import { Dynamic_Section, Dynamic_Category, Dynamic_Collection, Dynamic_Navigation, Dynamic_Other, Dynamic_Advertising, Dynamic_Article } from "./index";
const _props = defineProps<{
settings: any;
component?: any;
@@ -12,12 +12,11 @@ const definedDynamicComponent: Record<string, any> = {
[enumPageComponentTemplates.COLLECTION]: Dynamic_Collection,
[enumPageComponentTemplates.SECTION]: Dynamic_Section,
[enumPageComponentTemplates.OTHER]: Dynamic_Other,
[enumPageComponentTemplates.ADVERTISING]: Dynamic_Advertising
[enumPageComponentTemplates.ADVERTISING]: Dynamic_Advertising,
[enumPageComponentTemplates.NONE]: Dynamic_Navigation,
};
// console.log(_props.settings.template, 'template')
const getCurrentComponent = computed(() => `${_props.settings.template}`);
const GET_PROPS = computed(() => {
return () => {
let props: any = {};
@@ -36,5 +35,5 @@ const GET_PROPS = computed(() => {
<template>
<!-- <component :is="definedDynamicComponent[getCurrentComponent]" v-bind="{ ...(GET_PROPS()), component: _props.component, settings: _props.settings }" /> -->
<component :is="definedDynamicComponent[getCurrentComponent]" v-bind="{ ...(GET_PROPS()), component: _props.component, settings: _props.settings }" />
<component :is="definedDynamicComponent[getCurrentComponent]" v-bind="{ ...GET_PROPS(), component: _props.component, settings: _props.settings }" />
</template>