ssrRenderComponent.ts 552 B

1234567891011121314151617
  1. import { Component, ComponentInternalInstance, createVNode, Slots } from 'vue'
  2. import { Props, renderComponentVNode, SSRBuffer } from '../render'
  3. import { SSRSlots } from './ssrRenderSlot'
  4. export function ssrRenderComponent(
  5. comp: Component,
  6. props: Props | null = null,
  7. children: Slots | SSRSlots | null = null,
  8. parentComponent: ComponentInternalInstance | null = null,
  9. slotScopeId?: string
  10. ): SSRBuffer | Promise<SSRBuffer> {
  11. return renderComponentVNode(
  12. createVNode(comp, props, children),
  13. parentComponent,
  14. slotScopeId
  15. )
  16. }