fix. 컴포넌트 폴더 구조 변경

This commit is contained in:
clkim
2025-09-16 15:10:33 +09:00
parent 0b413bb197
commit 62e06b30f4
25 changed files with 58 additions and 37 deletions

View File

@@ -0,0 +1,26 @@
<script setup lang="ts">
import { useTemplateRegistry } from '#layers/composables/useTemplateRegistry'
import type { PageDataTemplate } from '#layers/types/api/pageData'
const props = defineProps<{ templates: PageDataTemplate[] }>()
const registry = useTemplateRegistry() as Record<string, { component: any }>
const isShowTemplate = (template: PageDataTemplate) => {
return template?.components && Object.keys(template.components).length > 0
}
</script>
<template>
<main>
<template
v-for="(template, index) in props.templates"
:key="template.template_code ?? index"
>
<component
:is="registry[template.template_code]?.component"
v-if="isShowTemplate(template)"
:components="template.components"
/>
</template>
</main>
</template>