Skip to content

WorkspaceLeaf.on('leaf-menu') method

WorkspaceLeaf › on(‘leaf-menu’)

Unofficial

Triggers when context menu action is executed on the leaf.

Signature:

on(name: "leaf-menu", callback: (menu: Menu, leaf: WorkspaceLeaf) => void, ctx?: unknown): EventRef

Parameters:

ParameterTypeDescription
name"leaf-menu"Should be 'leaf-menu'.
callback(menu: Menu, leaf: WorkspaceLeaf) => voidThe callback function.
ctx?unknownThe context passed as this to the callback function.

Returns: EventRefThe event reference.