feat: allow Menu.buildFromTemplate() to accept MenuItems (#16697)
* feat: allow Menu.buildFromTemplate to accept MenuItems * add another spec * fix linter error * add submenu spec
This commit is contained in:
parent
4211a9c69f
commit
858781ba83
3 changed files with 88 additions and 5 deletions
|
@ -52,15 +52,14 @@ for more information on macOS' native actions.
|
|||
|
||||
#### `Menu.buildFromTemplate(template)`
|
||||
|
||||
* `template` MenuItemConstructorOptions[]
|
||||
* `template` (MenuItemConstructorOptions | MenuItem)[]
|
||||
|
||||
Returns `Menu`
|
||||
|
||||
Generally, the `template` is an array of `options` for constructing a
|
||||
[MenuItem](menu-item.md). The usage can be referenced above.
|
||||
|
||||
You can also attach other fields to the element of the `template` and they
|
||||
will become properties of the constructed menu items.
|
||||
You can also attach other fields to the element of the `template` and they will become properties of the constructed menu items.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue