feat(Image): add @image-loading-icon-size、@image-error-icon-size var
This commit is contained in:
+17
-4
@@ -108,7 +108,9 @@ export default createComponent({
|
||||
if (this.loading && this.showLoading) {
|
||||
return (
|
||||
<div class={bem('loading')}>
|
||||
{this.slots('loading') || <Icon name="photo-o" size="22" />}
|
||||
{this.slots('loading') || (
|
||||
<Icon name="photo-o" class={bem('loading-icon')} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -116,7 +118,9 @@ export default createComponent({
|
||||
if (this.error && this.showError) {
|
||||
return (
|
||||
<div class={bem('error')}>
|
||||
{this.slots('error') || <Icon name="warning-o" size="22" />}
|
||||
{this.slots('error') || (
|
||||
<Icon name="warning-o" class={bem('error-icon')} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -142,14 +146,23 @@ export default createComponent({
|
||||
}
|
||||
|
||||
return (
|
||||
<img src={this.src} onLoad={this.onLoad} onError={this.onError} {...imgData} />
|
||||
<img
|
||||
src={this.src}
|
||||
onLoad={this.onLoad}
|
||||
onError={this.onError}
|
||||
{...imgData}
|
||||
/>
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div class={bem({ round: this.round })} style={this.style} onClick={this.onClick}>
|
||||
<div
|
||||
class={bem({ round: this.round })}
|
||||
style={this.style}
|
||||
onClick={this.onClick}
|
||||
>
|
||||
{this.genImage()}
|
||||
{this.genPlaceholder()}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user