fix. 컴포넌트 리팩토링, 타입 명시적 적용

This commit is contained in:
clkim
2025-09-17 15:43:47 +09:00
parent d9c26e651d
commit 4f3ac0e84a
13 changed files with 57 additions and 65 deletions

View File

@@ -1,12 +1,21 @@
<script setup lang="ts">
import { templateRegistry } from '#layers/registry'
import type { PageDataTemplate } from '#layers/types/api/pageData'
import type {
PageDataTemplate,
TemplateComponent,
} from '#layers/types/api/pageData'
const props = defineProps<{ templates: PageDataTemplate[] }>()
const registry = templateRegistry as Record<string, { component: any }>
const registry = templateRegistry as unknown as Record<
string,
{ component: TemplateComponent }
>
const isShowTemplate = (template: PageDataTemplate) => {
return template?.components && Object.keys(template.components).length > 0
return Boolean(
template?.components && Object.keys(template.components ?? {}).length > 0
)
}
</script>