Răsfoiți Sursa

fix:预览自动播放功能完善

Grnetsky 1 an în urmă
părinte
comite
e0c41e4262
1 a modificat fișierele cu 11 adăugiri și 1 ștergeri
  1. 11 1
      src/views/components/PenAnimates.vue

+ 11 - 1
src/views/components/PenAnimates.vue

@@ -226,13 +226,23 @@ const props = defineProps<{
 }>();
 function changeAnimateAutoPlay(value,item) {
   if(value){
-    if(props.pen.animations.length === 1)return
+    props.pen.autoPlay = true;
+    if(props.pen.animations.length === 1){
+      item.autoPlay = true
+      return
+    }
     props.pen.animations.forEach(i=>{
       if(i.name !== item.name){
         i.autoPlay = false
       }
     })
     item.autoPlay = true
+  }else {
+    let allFalse = props.pen.animations.every(i=>!i.autoPlay);
+    if(allFalse) {
+      props.pen.autoPlay = false
+      props.pen.frames = null
+    }
   }
 }
 const penTree: any = ref([]);