Files
canvas-editor_fex765/docs/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

21 lines
544 B
Markdown

# 自定义右键菜单
## 使用方式
```javascript
import Editor from "@hufe921/canvas-editor"
const instance = new Editor(container, <IElement[]>data, options)
instance.register.contextMenuList([
{
isDivider?: boolean;
icon?: string;
name?: string; // 使用%s代表选区文本。示例:搜索:%s
shortCut?: string;
when?: (payload: IContextMenuContext) => boolean;
callback?: (command: Command, context: IContextMenuContext) => any;
childMenus?: IRegisterContextMenu[];
}
])
```