fix(slots): compiled slot fallback should be functions (#1030)
This avoids it being collected as dynamic children when it's not used. fix #1021
This commit is contained in:
@@ -4,7 +4,8 @@ import {
|
||||
CallExpression,
|
||||
createCallExpression,
|
||||
ExpressionNode,
|
||||
SlotOutletNode
|
||||
SlotOutletNode,
|
||||
createFunctionExpression
|
||||
} from '../ast'
|
||||
import { isSlotOutlet, findProp } from '../utils'
|
||||
import { buildProps, PropsExpression } from './transformElement'
|
||||
@@ -29,7 +30,7 @@ export const transformSlotOutlet: NodeTransform = (node, context) => {
|
||||
if (!slotProps) {
|
||||
slotArgs.push(`{}`)
|
||||
}
|
||||
slotArgs.push(children)
|
||||
slotArgs.push(createFunctionExpression([], children, false, false, loc))
|
||||
}
|
||||
|
||||
node.codegenNode = createCallExpression(
|
||||
|
||||
Reference in New Issue
Block a user