Fixed #1836 - For TabMenu

pull/1846/head
mertsincan 2021-12-01 23:54:30 +03:00
parent 38daad7448
commit 7755627c4c
1 changed files with 63 additions and 10 deletions

View File

@ -1,18 +1,71 @@
interface TabMenuProps { import { VNode } from 'vue';
model?: any[]; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
exact?: boolean; import { MenuItem } from '../menuitem';
activeIndex?: number;
export interface TabMenuChangeEvent {
/**
* Browser event
*/
originalEvent: Event;
/**
* Index of the selected tab
*/
index: number;
} }
interface TabMenuItemSlotInterface { export interface TabMenuProps {
item: any; /**
* 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;
} }
declare class TabMenu { export interface TabMenuSlots {
$props: TabMenuProps; /**
$slots: { * Custom content for each item.
item: TabMenuItemSlotInterface; * @param {Object} scope - item slot's params.
*/
item: (scope: {
/**
* Menuitem instance
*/
item: MenuItem;
}) => VNode[];
}
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; export default TabMenu;