Selaa lähdekoodia

fix: 修复message提示死循环的问题

chenhao 3 vuotta sitten
vanhempi
commit
8361690153
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      src/features/mark/MarkDrawTrack.vue

+ 5 - 2
src/features/mark/MarkDrawTrack.vue

@@ -28,7 +28,7 @@
 
 <script setup lang="ts">
 import type { SpecialTag, Track } from "@/types";
-import { toRefs, watch } from "vue";
+import { toRefs, watch, nextTick } from "vue";
 import { store } from "@/store/store";
 import { message } from "ant-design-vue";
 
@@ -53,7 +53,10 @@ const computeTopAndLeft = (track: Track | SpecialTag) => {
     leftInsideSliceRatio < 0 ||
     leftInsideSliceRatio > 1
   ) {
-    void message.error("轨迹坐标有误,可能是图片被修改过,请联系管理员!");
+    /** 解决message提示死循环的问题 */
+    nextTick(() => {
+      void message.error("轨迹坐标有误,可能是图片被修改过,请联系管理员!");
+    });
   }
 
   return {