From 0bc6359dcadc56313843a6dde2a1e54f77afa8d4 Mon Sep 17 00:00:00 2001 From: Ethan-Zhang Date: Fri, 14 Nov 2025 08:56:22 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E5=BC=95=E7=94=A8=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=A1=8C=E4=B8=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dialoguePanel/DialoguePanel.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/dialoguePanel/DialoguePanel.vue b/src/components/dialoguePanel/DialoguePanel.vue index 7a2aba33..3c192dd2 100644 --- a/src/components/dialoguePanel/DialoguePanel.vue +++ b/src/components/dialoguePanel/DialoguePanel.vue @@ -271,10 +271,18 @@ const handleMarkNumberClick = (event: MouseEvent) => { let markCounter = 0; // 为每个标记生成唯一索引 const processMarkedContent = (content: string) => { markCounter = 0; // 重置计数器 - return content.replace(/\[\[(\d+)\]\]/g, (_match, value) => { - const uniqueId = `mark_${props.cid}_${markCounter++}`; - return `${value} `; + + const result = content.replace(/\[\[(\d+)\]\]/g, (_match, value) => { + const uniqueId = `mark_${props.cid}_${markCounter}`; + markCounter++; + + const displayNumber = parseInt(value, 10); + const fileIndex = displayNumber - 1; + + return `${value} `; }); + + return result; }; // 🔑 监听activeMarkId变化,更新DOM元素的激活状态 -- Gitee