From 27b2f4ee49ab058902d7128b7e98c1fed753a0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E8=83=9C=E5=BC=BA?= Date: Wed, 19 Dec 2018 19:54:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3resize-sensor=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=AC=AC=E4=B8=80=E6=AC=A1=E4=BA=8B=E4=BB=B6=E8=A7=82?= =?UTF-8?q?=E6=B5=8B=E5=AE=9E=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/resize-sensor/index.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/view/components/resize-sensor/index.vue b/src/core/view/components/resize-sensor/index.vue index 94192514e..d35b79a59 100644 --- a/src/core/view/components/resize-sensor/index.vue +++ b/src/core/view/components/resize-sensor/index.vue @@ -10,8 +10,8 @@ export default { data: function () { return { size: { - width: 0, - height: 0 + width: -1, + height: -1 } } }, @@ -19,15 +19,10 @@ export default { size: { deep: true, handler: function (size) { - this.reset() this.$emit('resize', Object.assign({}, size)) } } }, - beforeDestroy: function () { - this.$emit('resize', { width: 0, height: 0 }) - this.$emit('resizeSensorBeforeDestroy') - }, mounted: function () { if (this.initial === true) { this.$nextTick(this.update) @@ -65,6 +60,7 @@ export default { update: function () { this.size.width = this.$el.offsetWidth this.size.height = this.$el.offsetHeight + this.reset() } }, render: function (create) { @@ -94,7 +90,7 @@ export default {