Skip to content

Commit

Permalink
fix(runtime-core): fix mouting of detached static vnode
Browse files Browse the repository at this point in the history
fix #4023
  • Loading branch information
yyx990803 committed Jul 1, 2021
1 parent d2df28d commit fded1e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit fded1e8

Please sign in to comment.