提交 6ed85da1 编写于 作者: shutao-dc's avatar shutao-dc

update resize-observer.uvue

上级 dd91efd6
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
outBoxSizeInfo: "", outBoxSizeInfo: "",
innerBoxSizeInfo: "", innerBoxSizeInfo: "",
offset: 2, offset: 2,
boxDisplay: true, boxDisplay: false,
outBoxElement: null as UniElement | null, outBoxElement: null as UniElement | null,
innerBoxElement: null as UniElement | null, innerBoxElement: null as UniElement | null,
resizeObserver: null as UniResizeObserver | null resizeObserver: null as UniResizeObserver | null
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
} }
return false return false
}, },
onShow() { onReady() {
if (this.resizeObserver == null) { if (this.resizeObserver == null) {
this.resizeObserver = new UniResizeObserver((entries : Array<UniResizeObserverEntry>) => { this.resizeObserver = new UniResizeObserver((entries : Array<UniResizeObserverEntry>) => {
entries.forEach(entry => { entries.forEach(entry => {
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
this.innerBoxElement = uni.getElementById("innerBox") this.innerBoxElement = uni.getElementById("innerBox")
if (this.innerBoxElement != null) { if (this.innerBoxElement != null) {
this.resizeObserver!.observe(this.innerBoxElement!) this.resizeObserver!.observe(this.innerBoxElement!)
} }
this.boxDisplay = true
} }
}, },
methods: { methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册