MenuWithRoleOptions
Options for constructing a menu with a role.
import { MenuWithRoleOptions } from '@mobrowser/api';
Example
import { app, Menu, MenuWithRole, MenuItem } from '@mobrowser/api';
const fileMenu = new MenuWithRole({
role: 'fileMenu',
items: [
new MenuItem({
id: 'new',
label: 'New',
action: (item: MenuItem) => { }
})
]
]})
app.setMenu(new Menu({ label: 'App', items: [fileMenu] }))
Properties
role
readonly role: MenuRole;
The role of the menu.
items
readonly items: (MenuElement | MenuItemRole)[];
The items of the menu.