diff --git a/src/core/view/components/image/index.vue b/src/core/view/components/image/index.vue index 08cd2c416f5d3aae19c98f522388a92ea6fa865e..9b4f6edfcf807888134b8127b29eeb40535f4cf7 100644 --- a/src/core/view/components/image/index.vue +++ b/src/core/view/components/image/index.vue @@ -1,12 +1,12 @@ @@ -41,7 +41,7 @@ export default { return this.originalWidth && this.originalHeight ? this.originalWidth / this.originalHeight : 0 }, realImagePath () { - return this.$getRealPath(this.src) + return this.src && this.$getRealPath(this.src) }, modeStyle () { let size = 'auto' @@ -128,7 +128,7 @@ export default { } }, _loadImage () { - this.$refs.content.style.backgroundImage = `url(${this.realImagePath})` + this.$refs.content.style.backgroundImage = this.src ? `url(${this.realImagePath})` : 'none' const _self = this const img = new Image() @@ -197,4 +197,4 @@ export default { uni-image>.uni-image-will-change { will-change: transform; } - +