Sfoglia il codice sorgente

chore(Preview): 消除 onerror 参数类型错误

invalid w 1 anno fa
parent
commit
ec33820bf9
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/components/Preview/src/Functional.vue

+ 2 - 2
src/components/Preview/src/Functional.vue

@@ -210,8 +210,8 @@
           imgState.currentUrl = url;
           imgState.status = StatueEnum.DONE;
         };
-        img.onerror = (e: Event) => {
-          const ele: EventTarget[] = e.composedPath();
+        img.onerror = (e: Event | string) => {
+          const ele: EventTarget[] = (e as Event).composedPath();
           ele &&
             emit('img-error', {
               index: imgState.currentIndex,