feat(compiler): transform slot outlets
This commit is contained in:
12
packages/runtime-core/src/helpers/renderSlot.ts
Normal file
12
packages/runtime-core/src/helpers/renderSlot.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Slot } from '../componentSlots'
|
||||
import { VNodeChildren } from '../vnode'
|
||||
|
||||
export function renderSlot(
|
||||
slot: Slot | undefined,
|
||||
props: any = {},
|
||||
// this is not a user-facing function, so the fallback is always generated by
|
||||
// the compiler.
|
||||
fallback?: string | VNodeChildren
|
||||
): string | VNodeChildren | null {
|
||||
return slot ? slot() : fallback || null
|
||||
}
|
||||
Reference in New Issue
Block a user