Component

type ComponentItem = ComponentOrigin & { id: string; matchName?: string; }

type ComponentOrigin = {
  name: string
  props: ComponentProp[]
  source: ComponentSource
  slots?: ComponentSlot[]
  ignoreRect?: boolean
}
  • name: 组件名称。
  • props: 组件的被透传的属性, 详见ComponentProp
  • source: 组件的来源,以虚拟路径形式表达。
  • slots: 组件的插槽,类似于Vue的具名插槽SlotReact组件中的传递jsx来当做chilren,详见Slot
  • ignoreRect: 忽略布局信息,默认false

type ComponentSource = {
  path: string
  export: 'DEFAULT' | string
}
  • path: 组件的虚拟路径,如:'@/components/xxx.vue'。
  • export
    • DEFAULT: export default {} 为 DEFAULT
    • string: export const xxx = {} 为 xxx