File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1226,7 +1226,7 @@ function baseCreateRenderer(
12261226 if ( ! initialVNode . el ) {
12271227 const placeholder = ( instance . subTree = createVNode ( Comment ) )
12281228 processCommentNode ( null , placeholder , container ! , anchor )
1229- initialVNode . el = placeholder . el
1229+ initialVNode . placeholderEl = placeholder . el
12301230 }
12311231 } else {
12321232 setupRenderEffect (
@@ -1980,8 +1980,11 @@ function baseCreateRenderer(
19801980 for ( i = toBePatched - 1 ; i >= 0 ; i -- ) {
19811981 const nextIndex = s2 + i
19821982 const nextChild = c2 [ nextIndex ] as VNode
1983+ const anchorVNode = c2 [ nextIndex + 1 ] as VNode
19831984 const anchor =
1984- nextIndex + 1 < l2 ? ( c2 [ nextIndex + 1 ] as VNode ) . el : parentAnchor
1985+ nextIndex + 1 < l2
1986+ ? anchorVNode . el || anchorVNode . placeholderEl
1987+ : parentAnchor
19851988 if ( newIndexToOldIndexMap [ i ] === 0 ) {
19861989 // mount new
19871990 patch (
Original file line number Diff line number Diff line change @@ -217,6 +217,11 @@ export interface VNode<
217217 */
218218 ssFallback : VNode | null
219219
220+ /**
221+ * @internal
222+ */
223+ placeholderEl : HostNode | null
224+
220225 // optimization only
221226 shapeFlag : number
222227 patchFlag : number
@@ -711,6 +716,8 @@ export function cloneVNode<T, U>(
711716 suspense : vnode . suspense ,
712717 ssContent : vnode . ssContent && cloneVNode ( vnode . ssContent ) ,
713718 ssFallback : vnode . ssFallback && cloneVNode ( vnode . ssFallback ) ,
719+ placeholderEl : vnode . placeholderEl ,
720+
714721 el : vnode . el ,
715722 anchor : vnode . anchor ,
716723 ctx : vnode . ctx ,
You can’t perform that action at this time.
0 commit comments