add onLoad callback
This commit is contained in:
parent
0ac97353f2
commit
65089091ec
@ -5,7 +5,7 @@ export class DoricImageNode extends DoricViewNode {
|
|||||||
return document.createElement('img')
|
return document.createElement('img')
|
||||||
}
|
}
|
||||||
|
|
||||||
blendProps(v: HTMLParagraphElement, propName: string, prop: any) {
|
blendProps(v: HTMLImageElement, propName: string, prop: any) {
|
||||||
switch (propName) {
|
switch (propName) {
|
||||||
case 'imageUrl':
|
case 'imageUrl':
|
||||||
v.setAttribute('src', prop)
|
v.setAttribute('src', prop)
|
||||||
@ -15,7 +15,10 @@ export class DoricImageNode extends DoricViewNode {
|
|||||||
break
|
break
|
||||||
case 'loadCallback':
|
case 'loadCallback':
|
||||||
v.onload = () => {
|
v.onload = () => {
|
||||||
this.callJSResponse(prop)
|
this.callJSResponse(prop, {
|
||||||
|
width: v.width,
|
||||||
|
height: v.height
|
||||||
|
})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user