Explorar el Código

输入框键盘

CzRger hace 2 semanas
padre
commit
bd9e0e91b9
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/views/smart-ask-answer/assistant/chat.vue

+ 2 - 1
src/views/smart-ask-answer/assistant/chat.vue

@@ -216,12 +216,13 @@ const initTextHandle = () => {
   const floatingDiv = ref_auto.value
 
   textarea.addEventListener('keydown', (e) => {
-    e.preventDefault()
     if (e.ctrlKey && e.key === 'Enter') {
+      e.preventDefault()
       state.text += '\n'
       textarea.style.height = 'auto';
       textarea.style.height = Math.min(textarea.scrollHeight + 2, 200) + 'px';
     } else if (e.key === 'Enter') {
+      e.preventDefault()
       onSend()
     } else {
       textarea.style.height = 'auto';