diff --git a/components/lib/menu/Menu.d.ts b/components/lib/menu/Menu.d.ts index f2c997dfe..871456471 100755 --- a/components/lib/menu/Menu.d.ts +++ b/components/lib/menu/Menu.d.ts @@ -119,6 +119,14 @@ export interface MenuState { * Defines current options in Menu component. */ export interface MenuContext { + /** + * Current menuitem + */ + item: any; + /** + * Current index of the menuitem. + */ + index: number; /** * Current focused state of menuitem as a boolean. * @defaultValue false diff --git a/components/lib/menu/Menu.vue b/components/lib/menu/Menu.vue index 8d57cdf0d..bd23b71b9 100644 --- a/components/lib/menu/Menu.vue +++ b/components/lib/menu/Menu.vue @@ -30,7 +30,7 @@
  • - +
    diff --git a/components/lib/menu/Menuitem.vue b/components/lib/menu/Menuitem.vue index 241f6958d..cd355c357 100644 --- a/components/lib/menu/Menuitem.vue +++ b/components/lib/menu/Menuitem.vue @@ -47,7 +47,8 @@ export default { templates: null, exact: null, id: null, - focusedOptionId: null + focusedOptionId: null, + index: null }, methods: { getItemProp(processedItem, name) { @@ -56,6 +57,8 @@ export default { getPTOptions(key) { return this.ptm(key, { context: { + item: this.item, + index: this.index, focused: this.isItemFocused() } });