From 2c5e30480e5a2f38a443835c4765addf5dfe3582 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 22 Jul 2026 08:51:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20pc=E7=AB=AF=E7=9A=84=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E9=97=AE=E7=AD=94=E9=A1=B5=E9=9D=A2=E4=B8=AD=EF=BC=8C=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E4=B8=AD=E6=8C=89=E5=9B=9E=E8=BD=A6=E5=8F=91?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/ChatView.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index 1a5d2b5..adea5f5 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -84,6 +84,15 @@ async function submit() { } } +function onComposerKeydown(e) { + if (e.key !== 'Enter') return + if (e.shiftKey || e.ctrlKey || e.metaKey || e.altKey) return + if (e.isComposing || e.keyCode === 229) return + e.preventDefault() + if (streaming.value) return + submit() +} + async function onCreateSession() { try { await createSession() @@ -349,6 +358,7 @@ watch(messages, scrollToEnd, { deep: true }) rows="2" placeholder="输入问题,或上传图片/文件,AI 将为您解答..." :disabled="streaming" + @keydown="onComposerKeydown" />