From e34bb2a21ee97451388c0b611e5aefc29d68652e Mon Sep 17 00:00:00 2001 From: xuxin <15279969124@163.com> Date: Thu, 28 May 2026 15:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=8A=A9=E6=89=8Bai=E5=9B=9E?= =?UTF-8?q?=E7=AD=94=E5=86=85=E5=AE=B9=E6=8D=A2=E8=A1=8C=E7=AC=A6=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AiChat.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/AiChat.vue b/src/components/AiChat.vue index 1fd20e8..1bce7f2 100644 --- a/src/components/AiChat.vue +++ b/src/components/AiChat.vue @@ -44,7 +44,7 @@ class="ai-chat__msg" :class="msg.role === 'assistant' ? 'ai-chat__msg--ai' : 'ai-chat__msg--user'" > -
+ @@ -178,6 +178,13 @@ const quickQuestions = computed(() => { /** 用户提问列表(等同于 quickQuestions) */ const userQuestions = computed(() => quickQuestions.value) +// ==================== 内容格式化 ==================== + +/** 将消息中的换行符转为 HTML 换行标签 */ +function formatContent(content: string): string { + return content.replace(/\n/g, '