fix(hmr): always traverse static children in dev

fix #7921
close #8100
This commit is contained in:
Evan You 2023-04-20 14:31:54 +08:00
parent d53e157805
commit f17a82c769
1 changed files with 4 additions and 2 deletions

View File

@ -835,7 +835,8 @@ function baseCreateRenderer(
areChildrenSVG, areChildrenSVG,
slotScopeIds slotScopeIds
) )
if (__DEV__ && parentComponent && parentComponent.type.__hmrId) { if (__DEV__) {
// necessary for HMR
traverseStaticChildren(n1, n2) traverseStaticChildren(n1, n2)
} }
} else if (!optimized) { } else if (!optimized) {
@ -1110,7 +1111,8 @@ function baseCreateRenderer(
isSVG, isSVG,
slotScopeIds slotScopeIds
) )
if (__DEV__ && parentComponent && parentComponent.type.__hmrId) { if (__DEV__) {
// necessary for HMR
traverseStaticChildren(n1, n2) traverseStaticChildren(n1, n2)
} else if ( } else if (
// #2080 if the stable fragment has a key, it's a <template v-for> that may // #2080 if the stable fragment has a key, it's a <template v-for> that may