pre-refactor

This commit is contained in:
2026-06-17 03:41:08 +00:00
parent 318d7169f7
commit 687fa8f52f
19 changed files with 215 additions and 105 deletions
+5 -1
View File
@@ -218,7 +218,11 @@ function diffContainer(container, prev, vnodes) {
if (oldDom?.nodeType === Node.ELEMENT_NODE) sweepDom(oldDom);
const nd = createDom(newV);
_vnodeDom.set(newV, nd);
if (oldDom?.parentNode) oldDom.parentNode.replaceChild(nd, oldDom);
if (oldDom?.parentNode) {
oldDom.parentNode.replaceChild(nd, oldDom);
} else if (nd.parentNode !== container) {
container.insertBefore(nd, lastDom ? lastDom.nextSibling : null);
}
lastDom = nd;
}
}