-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38daad7
commit 7755627
Showing
1 changed file
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,71 @@ | ||
interface TabMenuProps { | ||
model?: any[]; | ||
exact?: boolean; | ||
activeIndex?: number; | ||
import { VNode } from 'vue'; | ||
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; | ||
import { MenuItem } from '../menuitem'; | ||
|
||
export interface TabMenuChangeEvent { | ||
/** | ||
* Browser event | ||
*/ | ||
originalEvent: Event; | ||
/** | ||
* Index of the selected tab | ||
*/ | ||
index: number; | ||
} | ||
|
||
export interface TabMenuProps { | ||
/** | ||
* An array of menuitems. | ||
*/ | ||
model?: MenuItem[] | undefined; | ||
/** | ||
* Defines if active route highlight should match the exact route path. | ||
* Default value is true. | ||
*/ | ||
exact?: boolean | undefined; | ||
/** | ||
* Active index of menuitem. | ||
* Default value is 0. | ||
*/ | ||
activeIndex?: number | undefined; | ||
} | ||
|
||
interface TabMenuItemSlotInterface { | ||
item: any; | ||
export interface TabMenuSlots { | ||
/** | ||
* Custom content for each item. | ||
* @param {Object} scope - item slot's params. | ||
*/ | ||
item: (scope: { | ||
/** | ||
* Menuitem instance | ||
*/ | ||
item: MenuItem; | ||
}) => VNode[]; | ||
} | ||
|
||
declare class TabMenu { | ||
$props: TabMenuProps; | ||
$slots: { | ||
item: TabMenuItemSlotInterface; | ||
export declare type TabMenuEmits = { | ||
/** | ||
* Callback to invoke when an active tab is changed. | ||
* @param {TabMenuChangeEvent} event - Custom tab change event. | ||
*/ | ||
'tab-change': (event: TabMenuChangeEvent) => void; | ||
} | ||
|
||
declare class TabMenu extends ClassComponent<TabMenuProps, TabMenuSlots, TabMenuEmits> { } | ||
|
||
declare module '@vue/runtime-core' { | ||
interface GlobalComponents { | ||
TabMenu: GlobalComponentConstructor<TabMenu> | ||
} | ||
} | ||
|
||
/** | ||
* | ||
* TabMenu is a navigation component that displays items as tab headers. Example below uses nested routes with TabMenu. | ||
* | ||
* Demos: | ||
* | ||
* - [TabMenu](https://www.primefaces.org/primevue/showcase/#/tabmenu) | ||
* | ||
*/ | ||
export default TabMenu; |