Jelajahi Sumber

修改watch判断AIloading的问题

11wqe1 1 bulan lalu
induk
melakukan
96eeb4f63e

+ 5 - 3
src/components/easy2/studyStudent.vue

@@ -16849,11 +16849,11 @@ export default {
     },
     worksStudent: {
       handler(newVal, oldVal) {
-          const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
-          const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
+          // const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
+          // const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
           // console.log('worksStudent',sum1,sum2);
           
-          if(sum1 != sum2){
+          if(JSON.stringify(newVal) !=  JSON.stringify(oldVal)){
               this.AIloading = [];
               this.loopLoading = [];
 
@@ -17804,6 +17804,8 @@ export default {
         }
       }
 
+      console.log('6666');
+
       this.navList[i].task[j].tool[k].isTool = !this.navList[i].task[j].tool[k]
         .isTool;
       var a = document.scrollingElement;

+ 3 - 3
src/components/studySutdentClass/studyStudent.vue

@@ -16428,11 +16428,11 @@ export default {
     },
     worksStudent: {
       handler(newVal, oldVal) {
-          const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
-          const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
+          // const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
+          // const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
           // console.log('worksStudent',sum1,sum2);
           
-          if(sum1 != sum2){
+          if(JSON.stringify(newVal) !=  JSON.stringify(oldVal)){
               this.AIloading = [];
               this.loopLoading = [];