fix
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2025-10-15 19:43:32 +08:00
parent 43e0376fba
commit 07c67d2694
5 changed files with 13 additions and 9 deletions

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
import { nanoid } from "nanoid"
import { copyToClipboard } from "utils/functions"
import { copyToClipboard, getRandomId } from "utils/functions"
// 动态导入 mermaid
let mermaid: any = null
@@ -63,7 +62,7 @@ const renderMermaid = async () => {
try {
// 确保 mermaid 已加载
const mermaidInstance = await loadMermaid()
const id = `mermaid-${nanoid()}`
const id = `mermaid-${getRandomId()}`
const { svg } = await mermaidInstance.render(id, modelValue.value)
mermaidContainer.value.innerHTML = svg