feat: pc端的智能问答页面中,输入框中按回车发送
This commit is contained in:
parent
809cdbe3f1
commit
2c5e30480e
|
|
@ -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"
|
||||
/>
|
||||
<div class="composer-row">
|
||||
<div class="composer-chips">
|
||||
|
|
|
|||
Loading…
Reference in New Issue