feat: 输入框清空的问题

This commit is contained in:
zoujing committed 2025-08-06 14:16:31 +08:00
1 parent fe0a36e446
commit af9c3c7c28
2 files changed
+2 -6

No files matched your search

-2
View File
@@ -78,8 +78,6 @@ const sendMessage = () => {
// 否则发送新消息
if (!inputMessage.value.trim()) return;
emit('send', inputMessage.value)
inputMessage.value = ''
emit('update:inputMessage', inputMessage.value)
// 发送后保持焦点(可选)
if (props.holdKeyboard && textareaRef.value) {
+2 -4
View File
@@ -235,9 +235,6 @@
if (!inputText.trim()) return;
handleNoHideKeyboard()
sendMessage(inputText)
if(!isSessionActive.value) {
inputMessage.value = ''
}
// 发送消息后保持键盘状态
if (holdKeyboard.value && inputAreaRef.value) {
setTimeout(() => {
@@ -343,6 +340,7 @@
}
}
chatMsgList.value.push(newMsg)
inputMessage.value = '';
sendChat(message, isInstruct)
console.log("发送的新消息:",JSON.stringify(newMsg))
}
@@ -466,7 +464,7 @@
console.log('请求完成');
}).catch(err => {
isSessionActive.value = false; // 出错也允许再次发送
console.log('error:', err)
console.log('error:', err);
});
// 打字机函数