Skip to content

Commit ac75959

Browse files
committed
fix: update
1 parent ea03d8e commit ac75959

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

packages/runtime-core/src/componentRenderUtils.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,6 @@ export function updateHOCHostEl(
461461
}
462462
if (root === vnode) {
463463
;(vnode = parent.vnode).el = el
464-
if (root.placeholder) {
465-
vnode.placeholder = root.placeholder
466-
}
467464
parent = parent.parent
468465
} else {
469466
break

packages/runtime-core/src/renderer.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,6 @@ function baseCreateRenderer(
12391239
const placeholder = (instance.subTree = createVNode(Comment))
12401240
processCommentNode(null, placeholder, container!, anchor)
12411241
initialVNode.placeholder = placeholder.el
1242-
updateHOCHostEl(instance, placeholder.el)
12431242
}
12441243
} else {
12451244
setupRenderEffect(
@@ -1997,7 +1996,9 @@ function baseCreateRenderer(
19971996
const anchor =
19981997
nextIndex + 1 < l2
19991998
? // #13559, fallback to el placeholder for unresolved async component
2000-
anchorVNode.el || anchorVNode.placeholder
1999+
anchorVNode.el ||
2000+
anchorVNode.placeholder ||
2001+
getSubTreeElement(anchorVNode)
20012002
: parentAnchor
20022003
if (newIndexToOldIndexMap[i] === 0) {
20032004
// mount new
@@ -2419,6 +2420,14 @@ function baseCreateRenderer(
24192420
)
24202421
}
24212422

2423+
const getSubTreeElement = (vnode: VNode): RendererNode | null => {
2424+
let current = vnode
2425+
while (current.component) {
2426+
current = current.component.subTree
2427+
}
2428+
return current.el || current.placeholder
2429+
}
2430+
24222431
return {
24232432
render,
24242433
hydrate,

0 commit comments

Comments
 (0)