Skip to content

Type Alias: ComponentFn<C, K>

API / @xmachines/play-vue / ComponentFn

type ComponentFn<C, K> = (ctx) => VNode | VNode[] | null | string;

Defined in: @json-render/vue

Component render function type for Vue

Type Parameters

Type Parameter
C extends Catalog
K extends keyof InferCatalogComponents<C>

Parameters

ParameterType
ctxComponentContext<C, K>

Returns

VNode | VNode[] | null | string

Example

const Button: ComponentFn<typeof catalog, "Button"> = ({ props, emit }) =>
h("button", { onClick: () => emit("press") }, props.label);