fix(transition): fix broken leave transition on dev root fragment (#5268)

This commit is contained in:
edison
2022-04-14 17:10:41 +08:00
committed by GitHub
parent 71c9536625
commit 767d212d20
2 changed files with 88 additions and 4 deletions

View File

@@ -2159,7 +2159,23 @@ function baseCreateRenderer(
const remove: RemoveFn = vnode => {
const { type, el, anchor, transition } = vnode
if (type === Fragment) {
removeFragment(el!, anchor!)
if (
__DEV__ &&
vnode.patchFlag > 0 &&
vnode.patchFlag & PatchFlags.DEV_ROOT_FRAGMENT &&
transition &&
!transition.persisted
) {
;(vnode.children as VNode[]).forEach(child => {
if (child.type === Comment) {
hostRemove(child.el!)
} else {
remove(child)
}
})
} else {
removeFragment(el!, anchor!)
}
return
}