liyongli 2 ani în urmă
părinte
comite
6fb4ad9b41
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      src/view/qh/index.vue

+ 3 - 3
src/view/qh/index.vue

@@ -68,7 +68,7 @@
           style="width: 100%; margin-bottom: 1em"
           color="#f3f4f6"
           size="large"
-          @click="chat = []"
+          @click="(chat = []), (chatlist = [])"
         >
           清除历史记录
         </el-button>
@@ -155,7 +155,7 @@ const num1 = ref(0.7);
 const num2 = ref(0.95);
 let chatlist = ref([]);
 let session_hash = Math.random().toString(36).substring(2);
-let index = -1;
+let index = 0;
 function saveText() {
   load.value = true;
   nextTick(() => {
@@ -175,10 +175,10 @@ function saveText() {
   const t = inputText.value;
   inputText.value = '';
 
+//   index++;
   if (chatlist.value.length > 5) {
     chatlist.value.shift();
   }
-  index++;
   createSocket(ws => {
     const data = ws.data || {};
     if (data.msg == 'send_hash')