diff --git a/api-generator/components/menubar.js b/api-generator/components/menubar.js index e36616ff2..a1cc25bfd 100644 --- a/api-generator/components/menubar.js +++ b/api-generator/components/menubar.js @@ -33,6 +33,10 @@ const MenubarSlots = [ { name: 'submenuicon', description: 'Custom submenu icon template.' + }, + { + name: 'itemicon', + description: 'Custom item icon template.' } ]; diff --git a/components/lib/menubar/Menubar.d.ts b/components/lib/menubar/Menubar.d.ts index 0c2070a26..e2a33e07d 100755 --- a/components/lib/menubar/Menubar.d.ts +++ b/components/lib/menubar/Menubar.d.ts @@ -77,6 +77,20 @@ export interface MenubarSlots { */ active: boolean; }): VNode[]; + /** + * Custom item icon template. + * @param {Object} scope - item icon slot's params. + */ + itemicon(scope: { + /** + * Menuitem instance + */ + item: MenuItem; + /** + * Style class of the item icon element. + */ + class: any; + }): VNode[]; } /** diff --git a/components/lib/menubar/Menubar.vue b/components/lib/menubar/Menubar.vue index a7ffcf325..d2ac8e8bd 100755 --- a/components/lib/menubar/Menubar.vue +++ b/components/lib/menubar/Menubar.vue @@ -27,7 +27,7 @@ class="p-menubar-root-list" role="menubar" :items="processedItems" - :template="$slots" + :templates="$slots" :root="true" :mobileActive="mobileActive" tabindex="0" diff --git a/components/lib/menubar/MenubarSub.vue b/components/lib/menubar/MenubarSub.vue index bdca322ea..b2958965f 100755 --- a/components/lib/menubar/MenubarSub.vue +++ b/components/lib/menubar/MenubarSub.vue @@ -16,20 +16,20 @@ :aria-posinset="getAriaPosInset(index)" >
-