diff --git a/pages/API/resize-observer/resize-observer.uvue b/pages/API/resize-observer/resize-observer.uvue index eeeeed112ba6414c642d87e0dc620eb926e04bc3..cd1f30545c155d5a0892bcb5058d1f4e2d6cdc2e 100644 --- a/pages/API/resize-observer/resize-observer.uvue +++ b/pages/API/resize-observer/resize-observer.uvue @@ -31,7 +31,7 @@ outBoxSizeInfo: "", innerBoxSizeInfo: "", offset: 2, - boxDisplay: true, + boxDisplay: false, outBoxElement: null as UniElement | null, innerBoxElement: null as UniElement | null, resizeObserver: null as UniResizeObserver | null @@ -43,7 +43,7 @@ } return false }, - onShow() { + onReady() { if (this.resizeObserver == null) { this.resizeObserver = new UniResizeObserver((entries : Array) => { entries.forEach(entry => { @@ -61,7 +61,8 @@ this.innerBoxElement = uni.getElementById("innerBox") if (this.innerBoxElement != null) { this.resizeObserver!.observe(this.innerBoxElement!) - } + } + this.boxDisplay = true } }, methods: {