diff --git a/components/lib/menubar/Menubar.d.ts b/components/lib/menubar/Menubar.d.ts index abb5a2ef7..4f5ac4c1b 100755 --- a/components/lib/menubar/Menubar.d.ts +++ b/components/lib/menubar/Menubar.d.ts @@ -151,6 +151,14 @@ export interface MenubarState { * Defines current options in Menubar component. */ export interface MenubarContext { + /** + * Current menuitem + */ + item: any; + /** + * Current index of the menuitem. + */ + index: number; /** * Current active state of menuitem as a boolean. * @defaultValue false diff --git a/components/lib/menubar/MenubarSub.vue b/components/lib/menubar/MenubarSub.vue index 76dc2d737..21b7c0aa5 100755 --- a/components/lib/menubar/MenubarSub.vue +++ b/components/lib/menubar/MenubarSub.vue @@ -14,27 +14,27 @@ :aria-level="level + 1" :aria-setsize="getAriaSetSize()" :aria-posinset="getAriaPosInset(index)" - v-bind="getPTOptions(processedItem, 'menuitem')" + v-bind="getPTOptions(processedItem, index, 'menuitem')" :data-p-highlight="isItemActive(processedItem)" :data-p-focused="isItemFocused(processedItem)" :data-p-disabled="isItemDisabled(processedItem)" > -
+
@@ -137,9 +137,11 @@ export default { getItemLabel(processedItem) { return this.getItemProp(processedItem, 'label'); }, - getPTOptions(processedItem, key) { + getPTOptions(processedItem, index, key) { return this.ptm(key, { context: { + item: processedItem, + index, active: this.isItemActive(processedItem), focused: this.isItemFocused(processedItem) }