fix. 코드 리팩토링, 워닝 수정

This commit is contained in:
clkim
2025-09-16 18:24:35 +09:00
parent 84b8607bec
commit d6301350ae
10 changed files with 317 additions and 250 deletions

View File

@@ -1,12 +1,16 @@
<script setup lang="ts">
interface Props {
tag: string
text: string
text?: string
imageSrc?: any
imageClass?: string
}
const props = defineProps<Props>()
const sanitizedContent = computed(() => {
return props.text?.replace(/\n/g, '<br/>') || ''
})
</script>
<template>
@@ -27,6 +31,6 @@ const props = defineProps<Props>()
:class="`${props.imageClass} hidden sm:block`"
/>
</template>
<span v-else v-html="text?.replace(/\n/g, '<br/>') || ''" />
<span v-else-if="text" v-dompurify-html="sanitizedContent" />
</component>
</template>

View File

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