Selaa lähdekoodia

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

invalid w 1 vuosi sitten
vanhempi
commit
ec33820bf9
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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,