diff --git a/api-generator/components/contextmenu.js b/api-generator/components/contextmenu.js index 0f77066ac..4c7030047 100644 --- a/api-generator/components/contextmenu.js +++ b/api-generator/components/contextmenu.js @@ -40,7 +40,11 @@ const ContextMenuProps = [ const ContextMenuSlots = [ { name: 'item', - description: 'Template of a menuitem.' + description: 'Custom item template.' + }, + { + name: 'submenuicon', + description: 'Custom submenu icon template.' } ]; diff --git a/components/lib/contextmenu/ContextMenu.d.ts b/components/lib/contextmenu/ContextMenu.d.ts index e47b02242..cf289aab1 100755 --- a/components/lib/contextmenu/ContextMenu.d.ts +++ b/components/lib/contextmenu/ContextMenu.d.ts @@ -73,6 +73,15 @@ export interface ContextMenuSlots { */ item: MenuItem; }): VNode[]; + /** + * Custom submenu icon template. + */ + submenuicon(scope: { + /** + * Whether item is active + */ + active: boolean; + }): VNode[]; } /** diff --git a/components/lib/contextmenu/ContextMenu.vue b/components/lib/contextmenu/ContextMenu.vue index dca4cd1cb..73da3e4dc 100755 --- a/components/lib/contextmenu/ContextMenu.vue +++ b/components/lib/contextmenu/ContextMenu.vue @@ -14,7 +14,7 @@ :menuId="id" :focusedItemId="focused ? focusedItemId : undefined" :items="processedItems" - :template="$slots.item" + :template="$slots" :activeItemPath="activeItemPath" :exact="exact" :aria-labelledby="ariaLabelledby" diff --git a/components/lib/contextmenu/ContextMenuSub.vue b/components/lib/contextmenu/ContextMenuSub.vue index 1b1826e8c..64b7f195b 100755 --- a/components/lib/contextmenu/ContextMenuSub.vue +++ b/components/lib/contextmenu/ContextMenuSub.vue @@ -17,7 +17,7 @@ :aria-posinset="getAriaPosInset(index)" >