From 68584c07a1f4818a6b32dc3715e2b9204c003d7f Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 16 Mar 2022 10:52:29 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=A2=9E=E5=8A=A0IE9=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=9A=84vertical=5Ffill=E5=8A=A8=E6=80=81=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/fill/auto.vtape.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/wrapper/layout/fill/auto.vtape.js b/src/core/wrapper/layout/fill/auto.vtape.js index 335a95f56..16491ebab 100644 --- a/src/core/wrapper/layout/fill/auto.vtape.js +++ b/src/core/wrapper/layout/fill/auto.vtape.js @@ -94,6 +94,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { }, mounted: function () { + if (window.ResizeObserver) { + this.resizeObserver = new window.ResizeObserver(this._handleResize.bind(this)); + this.resizeObserver.observe(this.element[0]); + } if (window.MutationObserver) { this.mutationObserver = new window.MutationObserver(this._handleResize.bind(this)); this.mutationObserver.observe(this.element[0], { @@ -105,6 +109,11 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { this._handleResize(); }, + destroyed: function () { + this.resizeObserver && this.resizeObserver.unobserve(this.element[0]); + this.mutationObserver && this.mutationObserver.disconnect(); + }, + resize: function () { this.layout.resize(); },