fix(runtime-core): should still do full traverse of stable fragment children in dev + hmr

This commit is contained in:
Evan You 2020-09-16 13:01:53 -04:00
parent bebd44f793
commit dd40ad8fca

View File

@ -1155,11 +1155,13 @@ function baseCreateRenderer(
parentSuspense, parentSuspense,
isSVG isSVG
) )
// #2080 if the stable fragment has a key, it's a <template v-for> that may if (__DEV__ && parentComponent && parentComponent.type.__hmrId) {
// get moved around. Make sure all root level vnodes inherit el. traverseStaticChildren(n1, n2)
// #2134 or if it's a component root, it may also get moved around } else if (
// as the component is being moved. // #2080 if the stable fragment has a key, it's a <template v-for> that may
if ( // get moved around. Make sure all root level vnodes inherit el.
// #2134 or if it's a component root, it may also get moved around
// as the component is being moved.
n2.key != null || n2.key != null ||
(parentComponent && n2 === parentComponent.subTree) (parentComponent && n2 === parentComponent.subTree)
) { ) {