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:
Shelley Vohr 2019-02-06 10:04:40 -08:00 committed by GitHub
parent 4211a9c69f
commit 858781ba83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 88 additions and 5 deletions

View file

@ -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