Explorar el Código

'图片赋值url后移'

zhangyu hace 5 años
padre
commit
7ad04a4009
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      saga-web-graph/src/items/SImageItem.ts

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

@@ -70,7 +70,6 @@ export class SImageItem extends SObjectItem {
     set url(v: string) {
         this._url = v;
         this.img = new Image();
-        this.img.src = v;
         this.img.onload = (): void => {
             this.isLoadOver = true;
             this.computeImgSize();
@@ -82,6 +81,7 @@ export class SImageItem extends SObjectItem {
             this.update();
             console.log("加载图片错误!", e);
         };
+        this.img.src = v;
     }
 
     /**