Files
canvas-editor_fex765/docs/en/guide/contextmenu-custom.md
T
9f8016884f docs: support document internationalization #222
* docs: add English docuemnt #213

* docs: support document internationalization #222

---------

Co-authored-by: Hufe921 <huangyunfeihufe@hotmail.com>
2023-07-27 21:22:26 +08:00

539 B

Customize Contextmenu

How to Use

import Editor from "@hufe921/canvas-editor"

const instance = new Editor(container, <IElement[]>data, options)
instance.register.contextMenuList([
    {
      isDivider?: boolean;
      icon?: string;
      name?: string; // Use %s for selection text. Example: Search: %s
      shortCut?: string;
      when?: (payload: IContextMenuContext) => boolean;
      callback?: (command: Command, context: IContextMenuContext) => any;
      childMenus?: IRegisterContextMenu[];
    }
  ])