Skip to content

Commit ad243e7

Browse files
committed
fix(compiler-core): always track KeepAlive children as block inside v-for
1 parent 5e776ae commit ad243e7

File tree

1 file changed

+4
-1
lines changed
  • packages/compiler-core/src/transforms

1 file changed

+4
-1
lines changed

packages/compiler-core/src/transforms/vFor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
import {
4343
FRAGMENT,
4444
IS_MEMO_SAME,
45+
KEEP_ALIVE,
4546
OPEN_BLOCK,
4647
RENDER_LIST,
4748
} from '../runtimeHelpers'
@@ -208,7 +209,9 @@ export const transformFor: NodeTransform = createStructuralDirectiveTransform(
208209
)
209210
}
210211
}
211-
childBlock.isBlock = !isStableFragment
212+
// always track KeepAlive children as block
213+
childBlock.isBlock =
214+
childBlock.tag === KEEP_ALIVE || !isStableFragment
212215
if (childBlock.isBlock) {
213216
helper(OPEN_BLOCK)
214217
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent))

0 commit comments

Comments
 (0)