diff --git a/src/core/view/components/image/index.vue b/src/core/view/components/image/index.vue index c0a50d2c785140ed20245b9992d91b7e652b0326..d2887eeb2f4b7b52e43c2e1174ee36aa38aeb215 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' }