Skip to content

Commit b7842b6

Browse files
[autofix.ci] apply automated fixes
1 parent f71f201 commit b7842b6

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ export function buildSlots(
210210
vFor = findDir(slotElement, 'for')
211211
if (vFor) vForProps = vFor.exp
212212
else vForProps = undefined
213-
const slotFunction = buildSlotFn(slotProps, vForProps, slotChildren, slotLoc)
213+
const slotFunction = buildSlotFn(
214+
slotProps,
215+
vForProps,
216+
slotChildren,
217+
slotLoc
218+
)
214219

215220
// check if this slot is conditional (v-if/v-for)
216221
let vIf: DirectiveNode | undefined

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ export const ssrTransformComponent: NodeTransform = (node, context) => {
121121
// for later use.
122122
if (clonedNode.children.length) {
123123
buildSlots(clonedNode, context, (props, vFor, children) => {
124-
vnodeBranches.push(createVNodeSlotBranch(props, vFor, children, context))
124+
vnodeBranches.push(
125+
createVNodeSlotBranch(props, vFor, children, context)
126+
)
125127
return createFunctionExpression(undefined)
126128
})
127129
}

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

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,24 @@ export function ssrTransformSuspense(
3636
wipSlots: []
3737
}
3838
wipMap.set(node, wipEntry)
39-
wipEntry.slotsExp = buildSlots(node, context, (_props, _vFor, children, loc) => {
40-
const fn = createFunctionExpression(
41-
[],
42-
undefined, // no return, assign body later
43-
true, // newline
44-
false, // suspense slots are not treated as normal slots
45-
loc
46-
)
47-
wipEntry.wipSlots.push({
48-
fn,
49-
children
50-
})
51-
return fn
52-
}).slots
39+
wipEntry.slotsExp = buildSlots(
40+
node,
41+
context,
42+
(_props, _vFor, children, loc) => {
43+
const fn = createFunctionExpression(
44+
[],
45+
undefined, // no return, assign body later
46+
true, // newline
47+
false, // suspense slots are not treated as normal slots
48+
loc
49+
)
50+
wipEntry.wipSlots.push({
51+
fn,
52+
children
53+
})
54+
return fn
55+
}
56+
).slots
5357
}
5458
}
5559
}

0 commit comments

Comments
 (0)