fix(runtime-core): non-stable Fragment should always unmount its children (#2445)

fix #2444
This commit is contained in:
HcySunYang
2020-10-21 02:59:55 +08:00
committed by GitHub
parent 0227b4a697
commit fff62e2ee8
2 changed files with 48 additions and 1 deletions

View File

@@ -2038,7 +2038,12 @@ function baseCreateRenderer(
false,
true
)
} else if (!optimized && shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
} else if (
(type === Fragment &&
(patchFlag & PatchFlags.KEYED_FRAGMENT ||
patchFlag & PatchFlags.UNKEYED_FRAGMENT)) ||
(!optimized && shapeFlag & ShapeFlags.ARRAY_CHILDREN)
) {
unmountChildren(children as VNode[], parentComponent, parentSuspense)
}