Skip to content

Commit 84a733e

Browse files
committed
fix: ssr buildSlots not use cache
1 parent 4974e5d commit 84a733e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ export function buildSlots(
117117
node: ComponentNode,
118118
context: TransformContext,
119119
buildSlotFn: SlotFnBuilder = buildClientSlotFn,
120+
useCache: boolean = true,
120121
): {
121122
slots: SlotsExpression
122123
hasDynamicSlots: boolean
123124
} {
124-
// return early if slots are already built to avoid duplication
125-
if (node.slots) {
125+
// early return if slots are already built to avoid duplication
126+
if (useCache && node.slots) {
126127
return {
127128
slots: node.slots,
128129
hasDynamicSlots: node.hasDynamicSlots,

packages/compiler-ssr/src/transforms/ssrTransformComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export const ssrTransformComponent: NodeTransform = (node, context) => {
173173
}
174174

175175
const slots = node.children.length
176-
? buildSlots(node, context, buildSSRSlotFn).slots
176+
? buildSlots(node, context, buildSSRSlotFn, false).slots
177177
: `null`
178178

179179
if (typeof component !== 'string') {

0 commit comments

Comments
 (0)