本文整理汇总了TypeScript中Immutable.Map.first方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Map.first方法的具体用法?TypeScript Map.first怎么用?TypeScript Map.first使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Immutable.Map
的用法示例。
在下文中一共展示了Map.first方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: docContextMenu
export function docContextMenu(canvas: Canvas, e: any): void {
e.preventDefault();
canvas._canvasGlobalParam.canvasMouseUp(e);
if (canvas.props.onContextMenu) {
let contextMenuItems: IContextMenuItems[] = [];
const mouseEventType: string = canvas._mouseAndKeyUtil.onMouseEventType(e);
switch (mouseEventType) {
case 'component':
const currentSelectedComponent: Map<string, IComponent> = canvas._canvasGlobalParam.getSelectedComponents();
if (currentSelectedComponent.size === 1) {
contextMenuItems = currentSelectedComponent.first().getContextMenuItems();
}
break;
case 'canvas':
contextMenuItems = [
{
type: 'menu',
label: '撤销',
enabled: canvas._undoStack.peek() ? true : false,
click: () => {
canvas.executeCommand({
t: CommandMap.CANVAS_UNDO
});
}
},
{
type: 'menu',
label: '重做',
enabled: canvas._redoStack.peek() ? true : false,
click: () => {
canvas.executeCommand({
t: CommandMap.CANVAS_REDO
});
}
},
{
type: 'separator'
},
{
type: 'menu',
label: '粘贴',
click: () => {
canvas.executeCommand({
t: CommandMap.COM_PASTE
});
}
}
];
break;
}
canvas.props.onContextMenu(e, contextMenuItems);
}
}