Procházet zdrojové kódy

修复已知问题

林旭祥 před 3 měsíci
rodič
revize
683bce5c48
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      src/views/sunshineRun/index.vue

+ 4 - 3
src/views/sunshineRun/index.vue

@@ -272,10 +272,11 @@ const initSunshineRun = () => {
       let myIndex = testList.value.findIndex((item: any) => {
         return item.student_id == e.data.student_id;
       })
-      if (myIndex != undefined) {
-        testList.value.splice(myIndex, 1);
+      if (myIndex != -1) {
+        //如果已经存在就删除
+        testList.value.splice(myIndex, 1);//删除数据
       }
-      testList.value.unshift(e.data);
+      testList.value.unshift(e.data);//插入数据
     }
   });
 };