Skip to content

Schema Structure

Complete JsonNode type definition.

Basic Properties

PropertyTypeRequiredDescription
comstringYesComponent type (HTML tag or registered component)
propsobjectNoProps passed to component
childrenJsonNode[] | stringNoChild nodes or text content

Data Properties

PropertyTypeDescription
dataRecord<string, any>Reactive data definition
computedRecord<string, string>Computed properties (expression strings)
methodsRecord<string, Action>Method definitions

Directive Properties

PropertyTypeDescription
ifstringConditional rendering expression
showstringShow/hide expression
forstringLoop expression, e.g., "item in items"
keystringUnique key for loop items
modelstringTwo-way binding data path
refstringTemplate ref name

Event Properties

PropertyTypeDescription
eventsRecord<string, Action | Action[]>Event handlers

Lifecycle

PropertyTypeDescription
onMountedAction | Action[]Execute after mount
onUnmountedAction | Action[]Execute before unmount
onUpdatedAction | Action[]Execute after update
watchRecord<string, WatchConfig>Data watchers

API Properties

PropertyTypeDescription
initApistring | ApiConfigInitialize data API
uiApistring | ApiConfigDynamic UI API

Slot Properties

PropertyTypeDescription
slotsRecord<string, SlotConfig>Slot definitions

Complete Type Definition

typescript
interface JsonNode {
  com: string;
  props?: Record<string, any>;
  children?: JsonNode[] | string;
  
  data?: Record<string, any>;
  computed?: Record<string, string>;
  methods?: Record<string, Action | Action[]>;
  
  if?: string;
  show?: string;
  for?: string;
  key?: string;
  model?: string;
  ref?: string;
  
  events?: Record<string, Action | Action[]>;
  
  onMounted?: Action | Action[];
  onUnmounted?: Action | Action[];
  onUpdated?: Action | Action[];
  watch?: Record<string, WatchConfig | Action>;
  
  initApi?: string | ApiConfig;
  uiApi?: string | ApiConfig;
  
  slots?: Record<string, JsonNode[] | SlotConfig>;
}

interface WatchConfig {
  handler: Action | Action[];
  immediate?: boolean;
  deep?: boolean;
}

interface ApiConfig {
  url: string;
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
  headers?: Record<string, string>;
  body?: any;
  then?: Action | Action[];
  catch?: Action | Action[];
  ignoreBaseURL?: boolean;
}

interface SlotConfig {
  content: JsonNode[];
  slotProps?: string;
}

Released under the MIT License.