feat: 使用 v-dompurify-html 替换 v-html

pull/115/head
xingyu4j 2025-05-26 14:21:05 +08:00
parent be1889a0e0
commit 44cc41ec92
2 changed files with 2 additions and 4 deletions

View File

@ -273,9 +273,8 @@ const [Modal, modalApi] = useVbenModal({
<div <div
class="h-full rounded-md bg-gray-50 !p-0 text-gray-800 dark:bg-gray-800 dark:text-gray-200" class="h-full rounded-md bg-gray-50 !p-0 text-gray-800 dark:bg-gray-800 dark:text-gray-200"
> >
<!-- eslint-disable-next-line vue/no-v-html -->
<code <code
v-html="codeMap.get(activeKey)" v-dompurify-html="codeMap.get(activeKey)"
class="code-highlight" class="code-highlight"
></code> ></code>
</div> </div>

View File

@ -255,9 +255,8 @@ const [Modal, modalApi] = useVbenModal({
<div <div
class="h-full rounded-md bg-gray-50 !p-0 text-gray-800 dark:bg-gray-800 dark:text-gray-200" class="h-full rounded-md bg-gray-50 !p-0 text-gray-800 dark:bg-gray-800 dark:text-gray-200"
> >
<!-- eslint-disable-next-line vue/no-v-html -->
<code <code
v-html="codeMap.get(activeKey)" v-dompurify-html="codeMap.get(activeKey)"
class="code-highlight" class="code-highlight"
></code> ></code>
</div> </div>