web: fix image loading error
Signed-off-by: 田梓萱 <tianzixuan@bixin.cn>
This commit is contained in:
parent
b42dd438f0
commit
cc8976eefe
13
doric-web/dist/index.js
vendored
13
doric-web/dist/index.js
vendored
@ -7436,12 +7436,19 @@ var doric_web = (function (exports, axios, sandbox) {
|
||||
v.style.filter = '';
|
||||
}
|
||||
break;
|
||||
case 'hidden':
|
||||
super.blendProps(v, propName, prop);
|
||||
if (prop == true) {
|
||||
this.loadIntoTarget(v, '');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
super.blendProps(v, propName, prop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
loadIntoTarget(targetElement, src) {
|
||||
if (src) {
|
||||
this.clearStretchElementAttributes(targetElement);
|
||||
this.loadPlaceHolder(targetElement);
|
||||
let tempLoadElement = this.stretchInset ? document.createElement('img') : targetElement;
|
||||
@ -7485,6 +7492,12 @@ var doric_web = (function (exports, axios, sandbox) {
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.clearStretchElementAttributes(targetElement);
|
||||
targetElement.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
}
|
||||
loadImageWithStretch(v, src, stretchInset) {
|
||||
v.src = transparentBase64;
|
||||
v.style.borderImageSource = `url(${src})`;
|
||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@ -89,6 +89,12 @@ export class DoricImageNode extends DoricViewNode {
|
||||
v.style.filter = ''
|
||||
}
|
||||
break
|
||||
case 'hidden':
|
||||
super.blendProps(v, propName, prop);
|
||||
if (prop == true) {
|
||||
this.loadIntoTarget(v, '');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
super.blendProps(v, propName, prop)
|
||||
break
|
||||
@ -96,6 +102,7 @@ export class DoricImageNode extends DoricViewNode {
|
||||
}
|
||||
|
||||
private loadIntoTarget(targetElement: HTMLImageElement, src: any) {
|
||||
if (src) {
|
||||
this.clearStretchElementAttributes(targetElement)
|
||||
this.loadPlaceHolder(targetElement)
|
||||
let tempLoadElement = this.stretchInset ? document.createElement('img') : targetElement
|
||||
@ -136,6 +143,11 @@ export class DoricImageNode extends DoricViewNode {
|
||||
this.loadImageWithStretch(targetElement, src, this.stretchInset)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.clearStretchElementAttributes(targetElement)
|
||||
targetElement.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private loadImageWithStretch(v: HTMLImageElement, src: any, stretchInset: StretchInset) {
|
||||
|
Reference in New Issue
Block a user