thainv: ghép navigation
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user