Skip to content

Plugin.registerView method

Plugin › registerView

Official

Register a custom view.

Signature:

registerView(type: string, viewCreator: ViewCreator): void

Parameters:

ParameterTypeDescription
typestringThe view type.
viewCreatorViewCreatorA function that creates the view for a given leaf.

Returns: void

Since: 0.9.7

Example:

plugin.registerView('my-view', (leaf) => {
return new MyView(leaf);
});