Update CommandInputBar.vue
This commit is contained in:
@@ -8,12 +8,11 @@ const { t } = useI18n();
|
|||||||
const commandInput = ref('');
|
const commandInput = ref('');
|
||||||
|
|
||||||
const sendCommand = () => {
|
const sendCommand = () => {
|
||||||
const command = commandInput.value.trim();
|
const command = commandInput.value; // 获取原始输入,不进行 trim
|
||||||
if (command) {
|
// 无论输入框是否为空,都发送内容(空字符串或命令)加上换行符
|
||||||
console.log(`[CommandInputBar] Sending command: ${command}`);
|
console.log(`[CommandInputBar] Sending command: ${command || '<Enter>'} `); // 日志记录空回车
|
||||||
emit('send-command', command + '\n'); // 发送命令并附加换行符,模拟回车
|
emit('send-command', command + '\n'); // 发送命令(或空字符串)并附加换行符
|
||||||
commandInput.value = ''; // 清空输入框
|
commandInput.value = ''; // 清空输入框
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user