Interface CustomTagDefinition

Custom tags let you define your own tags and attach behaviour to them.

interface CustomTagDefinition {
    remove?: boolean;
    rendered: ((el: Element, data: any, instance: Recado, surface: Surface, vertex: Vertex) => any);
    template: string;
    updated: ((el: Element, data: any, instance: Recado, surface: Surface, vertex: Vertex) => any);
}

Properties

remove?: boolean

If set to true, the element rendered for this tag is removed from the DOM. The Toolkit uses this capability internally to add endpoints to the DOM.

rendered: ((el: Element, data: any, instance: Recado, surface: Surface, vertex: Vertex) => any)

This function is called whenever the tag is encountered during rendering. el is the root element for a fragment rendered using the definition's template. Note that at the time this is called, el is not yet in the DOM.

template: string

Template for the tag. Must have a single root element.

updated: ((el: Element, data: any, instance: Recado, surface: Surface, vertex: Vertex) => any)

This function is called whenever the tag is updated during an update call.

Version :