From 2294e8a8c7a84464f0b4b5c94273ee24026d99fc Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 3 Jun 2019 17:50:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20H5=20=E7=AB=AF=20im?= =?UTF-8?q?age=20=E7=BB=84=E4=BB=B6=20src=20=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=E4=BA=A7=E7=94=9F=E9=94=99=E8=AF=AF=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/image/index.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/view/components/image/index.vue b/src/core/view/components/image/index.vue index 08cd2c41..9b4f6edf 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; } - + -- GitLab