-
Notifications
You must be signed in to change notification settings - Fork 0
reference
Table of contents
Part of @node-menu/core
const menu = new Menu("TopMenu", { ... });
Defines the root element of a menu, generally rendered as a <nav> element in HTML.
name
Provide a name for the name
children
An array of objects or MenuItem instances to be used as menu items . The objects will be passed as options to the addChild method. You
must also provide the label attribute in the object.
Adds a single submenu item. See MenuItem for options reference.
Returns the newly created MenuItem instance.
This object represents a menu item, generally rendered as a <li><a>...</a></li> in HTML. It's API is very similar to
Menu though.
label
Label of the menu, which is generally used as the visible text of the menu item
href
Link of the menu item
isCurrent
boolean set to true when the item must have an active/current state
parent
Reference to the parent Menu or MenuItem
children
Array of instances of MenuItem or objects similar to the addChild options including the label property.
Adds a submenu and -if needed- creates an instance of MenuItem. label and options are equal to the MenuItem constructor arguments.