|
@@ -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);//插入数据
|
|
|
}
|
|
|
});
|
|
|
};
|