liyongli 2 years ago
parent
commit
7f88d50664
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/view/chatGptChatNew/index.vue

+ 4 - 4
src/view/chatGptChatNew/index.vue

@@ -30,6 +30,7 @@
       placeholder="请输入您的问题"
       type="textarea"
       @focus="focus"
+      @blur="blur"
     >
       <template #button>
         <van-button
@@ -137,10 +138,9 @@ function saveText() {
 function focus() {
   if (!isIpad && !isIpod && !isIphone) return;
   !inputText.value && (inputText.value = ' ');
-  let t = window.setTimeout(() => {
-    inputText.value == ' ' && (inputText.value = '');
-    window.clearTimeout(t);
-  }, 100);
+}
+function blur() {
+  inputText.value == ' ' && (inputText.value = '');
 }
 </script>
 <style lang="scss">