add onLoad callback

This commit is contained in:
pengfei.zhou 2019-12-21 18:13:46 +08:00
parent 0ac97353f2
commit 65089091ec

View File

@ -5,7 +5,7 @@ export class DoricImageNode extends DoricViewNode {
return document.createElement('img')
}
blendProps(v: HTMLParagraphElement, propName: string, prop: any) {
blendProps(v: HTMLImageElement, propName: string, prop: any) {
switch (propName) {
case 'imageUrl':
v.setAttribute('src', prop)
@ -15,7 +15,10 @@ export class DoricImageNode extends DoricViewNode {
break
case 'loadCallback':
v.onload = () => {
this.callJSResponse(prop)
this.callJSResponse(prop, {
width: v.width,
height: v.height
})
}
break
default: