diff --git a/api-generator/components/tabmenu.js b/api-generator/components/tabmenu.js index 8ac64f24a..de136a868 100644 --- a/api-generator/components/tabmenu.js +++ b/api-generator/components/tabmenu.js @@ -10,6 +10,31 @@ const TabMenuProps = [ type: "boolean", default: "true", description: "Defines if active route highlight should match the exact route path." + }, + { + name: "activeIndex", + type: "number", + default: "0", + description: "Active index of menuitem." + } +]; + +const TabMenuEvents = [ + { + name: "tab-change", + description: "Callback to invoke when an active tab is changed.", + arguments: [ + { + name: "event.originalEvent", + type: "object", + description: "Original event" + }, + { + name: "event.index", + type: "number", + description: "Index of the selected tab" + } + ] } ]; @@ -25,6 +50,7 @@ module.exports = { name: "TabMenu", description: "TabMenu is a navigation component that displays items as tab headers.", props: TabMenuProps, + events: TabMenuEvents, slots: TabMenuSlots } }; diff --git a/src/components/tabmenu/TabMenu.d.ts b/src/components/tabmenu/TabMenu.d.ts index 31942d9c7..a33d7aaa5 100755 --- a/src/components/tabmenu/TabMenu.d.ts +++ b/src/components/tabmenu/TabMenu.d.ts @@ -3,6 +3,7 @@ import { VNode } from 'vue'; interface TabMenuProps { model?: any[]; exact?: boolean; + activeIndex?: number; } declare class TabMenu { diff --git a/src/components/tabmenu/TabMenu.vue b/src/components/tabmenu/TabMenu.vue index 340ca35fa..fbc7c4f01 100755 --- a/src/components/tabmenu/TabMenu.vue +++ b/src/components/tabmenu/TabMenu.vue @@ -5,7 +5,7 @@