import { Slot } from '../componentSlots' import { VNodeChildren, openBlock, createBlock, Fragment, VNode } from '../vnode' export function renderSlot( slots: Record, key: string, props: any = {}, // this is not a user-facing function, so the fallback is always generated by // the compiler and gurunteed to be an array fallback?: VNodeChildren ): VNode { const slot = slots[key] return ( openBlock(), createBlock( Fragment, { key: props.key }, slot ? slot(props) : fallback || [] ) ) }