From a431867f41cc038734a562ea8e25f6b4b00da932 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Tue, 21 May 2024 22:18:03 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91AI=20chat?= =?UTF-8?q?=20=E5=8F=91=E9=80=81=E6=8C=89=E9=92=AE=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/index.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index a5c6da69..0f091ec1 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -56,7 +56,7 @@ @@ -254,6 +254,10 @@ const onSend = async (event) => { } } +const onSendBtn = async () => { + await doSend(prompt.value?.trim() as string) +} + const doSend = async (content: string) => { if (content.length < 2) { ElMessage({ @@ -303,6 +307,10 @@ const doSendStream = async (userMessage: ChatMessageVO) => { content: '思考中...', createTime: new Date() } as ChatMessageVO) + // 滚动到最下面 + nextTick(async () => { + await scrollToBottom() + }) // 开始滚动 textRoll() // 发送 event stream