bill 4 ماه پیش
والد
کامیت
31136f21d8
1فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 8 2
      src/views/animation/left.vue

+ 8 - 2
src/views/animation/left.vue

@@ -50,6 +50,7 @@ import { TabPane, Tabs } from "ant-design-vue";
 import { ams, AnimationModel, createAnimationModel } from "@/store/animation";
 import { useSelects } from "@/hook/ids";
 import { fetchMaterialGroups } from "@/api/material";
+import { amMap } from "@/sdk/association/animation";
 
 useViewStack(() =>
   togetherCallback([
@@ -80,8 +81,13 @@ const updateSelectAm = (item: AnimationModel, select: boolean) => {
 
 // if (import.meta.env.DEV) {
 activeKey.value = "animation";
-setTimeout(() => {
-  emit("update:focus", ams.value[0]);
+const stop = watchEffect(() => {
+  if (amMap[ams.value[0]?.id].am) {
+    setTimeout(() => {
+      emit("update:focus", ams.value[0]);
+      stop();
+    });
+  }
 });
 // }