MenuItem d.ts updated
parent
e6af1b56c0
commit
100bcc9c53
|
@ -1,11 +1,16 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* PrimeVue menu components share a common api to specify the menuitems and submenus.
|
||||||
|
*
|
||||||
|
* @module menuitem
|
||||||
|
*
|
||||||
|
*/
|
||||||
import { RouteLocationRaw } from 'vue-router';
|
import { RouteLocationRaw } from 'vue-router';
|
||||||
|
|
||||||
type MenuItemLabelType = string | ((...args: any) => string) | undefined;
|
/**
|
||||||
|
* Custom command event.
|
||||||
type MenuItemDisabledType = boolean | ((...args: any) => boolean) | undefined;
|
* @see {@link MenuItem.command}
|
||||||
|
*/
|
||||||
type MenuItemVisibleType = boolean | ((...args: any) => boolean) | undefined;
|
|
||||||
|
|
||||||
export interface MenuItemCommandEvent {
|
export interface MenuItemCommandEvent {
|
||||||
/**
|
/**
|
||||||
* Browser event.
|
* Browser event.
|
||||||
|
@ -21,11 +26,15 @@ export interface MenuItemCommandEvent {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines model of MenuItem API.
|
||||||
|
* @group Model
|
||||||
|
*/
|
||||||
export interface MenuItem {
|
export interface MenuItem {
|
||||||
/**
|
/**
|
||||||
* Property name or getter function to use as the label of an item.
|
* Property name or getter function to use as the label of an item.
|
||||||
*/
|
*/
|
||||||
label?: MenuItemLabelType;
|
label?: string | ((...args: any) => string) | undefined;
|
||||||
/**
|
/**
|
||||||
* Icon of the item.
|
* Icon of the item.
|
||||||
*/
|
*/
|
||||||
|
@ -36,9 +45,9 @@ export interface MenuItem {
|
||||||
to?: RouteLocationRaw | undefined;
|
to?: RouteLocationRaw | undefined;
|
||||||
/**
|
/**
|
||||||
* Callback to execute when item is clicked.
|
* Callback to execute when item is clicked.
|
||||||
* @param {@link MenuItemCommandEvent} event - Custom command event.
|
* @param {MenuItemCommandEvent} event - Custom command event.
|
||||||
*/
|
*/
|
||||||
command?: (event: MenuItemCommandEvent) => void;
|
command?(event: MenuItemCommandEvent): void;
|
||||||
/**
|
/**
|
||||||
* External link to navigate when item is clicked.
|
* External link to navigate when item is clicked.
|
||||||
*/
|
*/
|
||||||
|
@ -49,18 +58,21 @@ export interface MenuItem {
|
||||||
items?: MenuItem[] | undefined;
|
items?: MenuItem[] | undefined;
|
||||||
/**
|
/**
|
||||||
* A boolean or a function to return a boolean to specify if the item is disabled.
|
* A boolean or a function to return a boolean to specify if the item is disabled.
|
||||||
|
* @defaultValue false
|
||||||
*/
|
*/
|
||||||
disabled?: MenuItemDisabledType;
|
disabled?: boolean | ((...args: any) => boolean) | undefined;
|
||||||
/**
|
/**
|
||||||
* A boolean or a function to return a boolean to specify if the item is visible.
|
* A boolean or a function to return a boolean to specify if the item is visible.
|
||||||
|
* @defaultValue true
|
||||||
*/
|
*/
|
||||||
visible?: MenuItemVisibleType;
|
visible?: boolean | ((...args: any) => boolean) | undefined;
|
||||||
/**
|
/**
|
||||||
* Specifies where to open the linked document.
|
* Specifies where to open the linked document.
|
||||||
*/
|
*/
|
||||||
target?: string | undefined;
|
target?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* Defines the item as a separator.
|
* Defines the item as a separator.
|
||||||
|
* @defaultValue false
|
||||||
*/
|
*/
|
||||||
separator?: boolean | undefined;
|
separator?: boolean | undefined;
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue