lsc 2 年之前
父節點
當前提交
38d455a281
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/components/pages/addCourse.vue

+ 5 - 3
src/components/pages/addCourse.vue

@@ -4486,9 +4486,7 @@ export default {
           }
 
           for (let i = 0; i < unitJson.length; i++) {
-            if (i == _unitIndex) {
-              continue;
-            } else if (
+            if (
               _unitJson[i].chapterInfo[0].chapterid ==
               unitJson[i].chapterInfo[0].chapterid
             ) {
@@ -4499,6 +4497,9 @@ export default {
             ) {
               _unitJson.splice(i, 0, unitJson[i]);
             }
+            // if (i == _unitIndex) {
+            //   continue;
+            // } else 
             // else if (i > this.unitJson.length - 1) {
             //   _unitJson.push(unitJson[i]);
             // }
@@ -4514,6 +4515,7 @@ export default {
                 _unitJson[n].chapterInfo[0].chapterid
               ) {
                 this.unitIndex = n;
+                _unitJson[n] = _unitJson2[this.unitIndex];
                 break;
               }
             }