Skip to content

Function: defineRegistry()

API / @xmachines/play-vue / defineRegistry

function defineRegistry<C>(catalog, options): DefineRegistryResult;

Defined in: packages/play-vue/src/define-registry.ts:138

Creates a component registry. It wraps each .vue SFC, so that the SFC works correctly with the render pipeline of @xmachines/json-render-vue.

This function is the drop-in replacement for defineRegistry from @xmachines/json-render-vue. Import it from @xmachines/play-vue, and you get the support for an SFC.

Type Parameters

Type Parameter
C extends Catalog<SchemaDefinition<SchemaType<string, unknown>, SchemaType<string, unknown>>, unknown>

Parameters

ParameterTypeDescription
catalogCThe json-render catalog. It defines the prop shape of each component.
optionsDefineRegistryOptions<C>The registry options. Each components entry is a .vue SFC, which is an object, or a plain ComponentFn function. The wrapper handles both.

Returns

DefineRegistryResult