]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): fix mouting of detached static vnode
authorEvan You <yyx990803@gmail.com>
Thu, 1 Jul 2021 20:11:50 +0000 (16:11 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 1 Jul 2021 20:11:50 +0000 (16:11 -0400)
fix #4023

packages/runtime-core/src/renderer.ts

index 1d1ebe77274d6f353fbdf503e2501889e4fafb96..d869cadd68e0b3e850c108c9db1fbee5bb8e696d 100644 (file)
@@ -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 = (