From 1ba20cda27478795f85ec63eb801e5a62b20606f Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 29 Jun 2021 11:35:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20image=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BD=BF=E7=94=A8=20transform=20=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=A4=A7=E5=B0=8F=E8=AE=A1=E7=AE=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=20question/125987?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/image/index.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/view/components/image/index.vue b/src/core/view/components/image/index.vue index c0a50d2c7..d2887eeb2 100644 --- a/src/core/view/components/image/index.vue +++ b/src/core/view/components/image/index.vue @@ -142,14 +142,13 @@ export default { _fixSize () { if (this.ratio) { const $el = this.$el - const rect = $el.getBoundingClientRect() if (this.mode === 'widthFix') { - const width = rect.width + const width = $el.offsetWidth if (width) { $el.style.height = fixNumber(width / this.ratio) + 'px' } } else if (this.mode === 'heightFix') { - const height = rect.height + const height = $el.offsetHeight if (height) { $el.style.width = fixNumber(height * this.ratio) + 'px' } -- GitLab