Explorar o código

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

zhangyu %!s(int64=5) %!d(string=hai) anos
pai
achega
da582e6896
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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);
         }