diff --git a/components/lib/tieredmenu/TieredMenu.d.ts b/components/lib/tieredmenu/TieredMenu.d.ts index 90da29753..6b935a5c3 100755 --- a/components/lib/tieredmenu/TieredMenu.d.ts +++ b/components/lib/tieredmenu/TieredMenu.d.ts @@ -135,6 +135,14 @@ export interface TieredMenuState { * Defines current options in TieredMenu component. */ export interface TieredMenuContext { + /** + * Current menuitem + */ + item: any; + /** + * Index of the menuitem. + */ + index: number; /** * Current active state of menuitem as a boolean. * @defaultValue false diff --git a/components/lib/tieredmenu/TieredMenuSub.vue b/components/lib/tieredmenu/TieredMenuSub.vue index 0c85a83c8..a7173748a 100755 --- a/components/lib/tieredmenu/TieredMenuSub.vue +++ b/components/lib/tieredmenu/TieredMenuSub.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)" > -
+
@@ -127,9 +127,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) }