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>