فهرست منبع

修复已知问题

林旭祥 3 ماه پیش
والد
کامیت
683bce5c48
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  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);//插入数据
     }
   });
 };