feat: pc端的智能问答页面中,输入框中按回车发送

This commit is contained in:
shijing 2026-07-22 08:51:00 +08:00
parent 809cdbe3f1
commit 2c5e30480e
1 changed files with 10 additions and 0 deletions

View File

@ -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() { async function onCreateSession() {
try { try {
await createSession() await createSession()
@ -349,6 +358,7 @@ watch(messages, scrollToEnd, { deep: true })
rows="2" rows="2"
placeholder="输入问题,或上传图片/文件AI 将为您解答..." placeholder="输入问题,或上传图片/文件AI 将为您解答..."
:disabled="streaming" :disabled="streaming"
@keydown="onComposerKeydown"
/> />
<div class="composer-row"> <div class="composer-row">
<div class="composer-chips"> <div class="composer-chips">