Parcourir la source

图片加载失败时刷新item绘制边框

zhangyu il y a 5 ans
Parent
commit
da582e6896
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      saga-web-graph/src/items/SImageItem.ts

+ 2 - 1
saga-web-graph/src/items/SImageItem.ts

@@ -38,8 +38,9 @@ export class SImageItem extends SObjectItem {
             this.isLoadOver = true;
             this.update();
         };
-        this.img.onerror = (e) => {
+        this.img.onerror = (e): void => {
             this.isLoadOver = false;
+            this.update();
             console.log("加载图片错误!");
             console.log(e);
         }