From 6ed85da1797feeabe3833d9691fc0a5234602aa5 Mon Sep 17 00:00:00 2001 From: shutao Date: Sun, 28 Apr 2024 15:20:14 +0800 Subject: [PATCH] update resize-observer.uvue --- pages/API/resize-observer/resize-observer.uvue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/API/resize-observer/resize-observer.uvue b/pages/API/resize-observer/resize-observer.uvue index eeeeed11..cd1f3054 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: { -- GitLab