优化layer动画触发

master
yutent 2023-09-04 15:54:46 +08:00
parent e8474c869b
commit eb3d26ea4a
1 changed files with 5 additions and 3 deletions

View File

@ -377,9 +377,11 @@ class Layer extends Component {
this.#play() this.#play()
} }
updated() { updated(props, force) {
if (force) {
this.#play() this.#play()
} }
}
moveTo(obj = {}) { moveTo(obj = {}) {
var css = '' var css = ''
@ -524,7 +526,7 @@ function layer(opt = {}) {
tmp.innerHTML = content tmp.innerHTML = content
layDom.appendChild(tmp.content.cloneNode(true)) layDom.appendChild(tmp.content.cloneNode(true))
layDom.updated() layDom.updated(null, true)
} else { } else {
layDom.innerHTML = content layDom.innerHTML = content
document.body.appendChild(layDom) document.body.appendChild(layDom)