fix. 코드 리팩토링, 워닝 수정
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user