Prechádzať zdrojové kódy

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

zhangyu 5 rokov pred
rodič
commit
da582e6896
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  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);
         }