From 1f86a9b8bb921072ddb60188b5a73f7ddef26f56 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 17 Apr 2023 09:14:45 +0300 Subject: [PATCH] Refactor #3832 Refactor #3833 - For Megamenu --- api-generator/components/megamenu.js | 4 ++++ components/lib/megamenu/MegaMenu.d.ts | 14 ++++++++++++++ components/lib/megamenu/MegaMenu.vue | 2 +- components/lib/megamenu/MegaMenuSub.vue | 14 +++++++------- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/api-generator/components/megamenu.js b/api-generator/components/megamenu.js index cc47ddc71..aebfd29f2 100644 --- a/api-generator/components/megamenu.js +++ b/api-generator/components/megamenu.js @@ -35,6 +35,10 @@ const MegaMenuSlots = [ { name: 'submenuicon', description: 'Custom submenu icon template.' + }, + { + name: 'itemicon', + description: 'Custom item icon template.' } ]; diff --git a/components/lib/megamenu/MegaMenu.d.ts b/components/lib/megamenu/MegaMenu.d.ts index 3f33559f8..fe03044fd 100755 --- a/components/lib/megamenu/MegaMenu.d.ts +++ b/components/lib/megamenu/MegaMenu.d.ts @@ -79,6 +79,20 @@ export interface MegaMenuSlots { */ 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/megamenu/MegaMenu.vue b/components/lib/megamenu/MegaMenu.vue index c0530c8b3..cc47f2f08 100755 --- a/components/lib/megamenu/MegaMenu.vue +++ b/components/lib/megamenu/MegaMenu.vue @@ -18,7 +18,7 @@ :focusedItemId="focused ? focusedItemId : undefined" :items="processedItems" :horizontal="horizontal" - :template="$slots" + :templates="$slots" :activeItem="activeItem" :exact="exact" :level="0" diff --git a/components/lib/megamenu/MegaMenuSub.vue b/components/lib/megamenu/MegaMenuSub.vue index 06fab2993..2c7fbc615 100644 --- a/components/lib/megamenu/MegaMenuSub.vue +++ b/components/lib/megamenu/MegaMenuSub.vue @@ -17,20 +17,20 @@ :aria-posinset="getAriaPosInset(index)" >
-