MenuItem

MenuItem

A MenuItem object as defined in the JSON schema. It represents an item in a menu. Depending on its type, a menu item can be either an option (type=option) or an option separator (type=content).

Constructor

Instantiates a new MenuItem

Parameters:
Name Type Description
props object

Properties to initialize the menu item with.

Properties
Name Type Attributes Description
description string

Sets MenuItem#description

textSearch string <optional>

Sets MenuItem#textSearch

method 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' <optional>

Sets MenuItem#method

path string <optional>

Sets MenuItem#path

src string <optional>

Sets MenuItem#src

onLoginFailure string <optional>

Sets MenuItem#onLoginFailure

onLoginSuccess string <optional>

Sets MenuItem#onLoginSuccess

onLogoutFailure string <optional>

Sets MenuItem#onLogoutFailure

onLogoutSuccess string <optional>

Sets MenuItem#onLogoutSuccess

card Card <optional>

= Sets Card

Source:

Members

alt :string

Alternative text if media cannot be downloaded .

Source:

card :Card

Sets a card object.

Source:

description :string

The displayed text of a menu item.

Source:

method :string

The HTTP method called when the menu item is selected.

Source:

onLoginFailure :string

Optional path to call on login failure, used when type='login'.

Source:

onLoginSuccess :string

Optional path to call on login success, used when type='login'.

Source:

onLogoutFailure :string

Optional path to call on logout failure, used when type='login'.

Source:

onLogoutSuccess :string

Optional path to call on logout success, used when type='login'.

Source:

path :string

The path called when the menu item is selected.

Source:

src :string

A public link to media file of type jpg|png|mp4 .

Source:

textSearch :string

Field to add more context for searching in options.

Source:

(readonly) type :string

The type of the menu item (content or option).

Source:

Methods

(static) fromTag(tag) → {MenuItem}

Creates a MenuItem from a SectionTag's child

Parameters:
Name Type Description
tag LiTag | BrTag | PTag | LoginTag | LogoutTag | string
Source: