From eb3d26ea4af77a99180aec4315a9b7e274dbabd4 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 4 Sep 2023 15:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96layer=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layer/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/layer/index.js b/src/layer/index.js index e8ee8f1..08d2d8e 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -377,8 +377,10 @@ class Layer extends Component { this.#play() } - updated() { - this.#play() + updated(props, force) { + if (force) { + this.#play() + } } moveTo(obj = {}) { @@ -524,7 +526,7 @@ function layer(opt = {}) { tmp.innerHTML = content layDom.appendChild(tmp.content.cloneNode(true)) - layDom.updated() + layDom.updated(null, true) } else { layDom.innerHTML = content document.body.appendChild(layDom)