thainv-dev: sửa lại cấu trúc folder

This commit is contained in:
nguyen van thai
2024-06-13 17:24:46 +07:00
parent 8818c73cec
commit ecf4512cd3
22 changed files with 1056 additions and 55 deletions
@@ -0,0 +1,34 @@
<script lang="ts" setup>
import { enumPageComponentTemplates, enumPageComponentLayouts } from "@/definitions/enum";
import { Article_Pagination } from "./index";
const _props = defineProps<{
settings: any;
component?: any;
}>();
const definedDynamicComponent: Record<string, any> = {
'TYPE:Article-LAYOUT:horizontal-DATA:HORIZONTAL': Article_Pagination
};
console.log('đã vào')
const getCurrentComponent = computed(() => `${_props.settings.layout}`);
console.log(getCurrentComponent.value, 'getcomponent')
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="definedDynamicComponent[getCurrentComponent]" v-bind="{ ...GET_PROPS(), component: _props.component, settings: _props.settings }" />
</template>