From fded1e8dfa22ca7fecd300c4cbffd6a37b887be8 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 1 Jul 2021 16:11:50 -0400 Subject: [PATCH] fix(runtime-core): fix mouting of detached static vnode fix #4023 --- packages/runtime-core/src/renderer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 1d1ebe77..d869cadd 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -686,14 +686,16 @@ function baseCreateRenderer( hostInsert(anchor!, container, nextSibling) } - const removeStaticNode = ({ el, anchor }: VNode) => { + const removeStaticNode = (vnode: VNode) => { let next + let { el, anchor } = vnode while (el && el !== anchor) { next = hostNextSibling(el) hostRemove(el) el = next } hostRemove(anchor!) + vnode.el = vnode.anchor = null } const processElement = (