From 058fa9673bf6138036b44b44b7a2a0db79c613e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 5 Apr 2023 14:57:18 +0300 Subject: [PATCH] Refactor #3832 Refactor #3833 - For TieredMenu --- api-generator/components/tieredmenu.js | 4 ++++ components/lib/tieredmenu/TieredMenu.d.ts | 9 +++++++++ components/lib/tieredmenu/TieredMenu.vue | 2 +- components/lib/tieredmenu/TieredMenuSub.vue | 14 ++++++++++---- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/api-generator/components/tieredmenu.js b/api-generator/components/tieredmenu.js index 5bfd02c8e..57b1b20d7 100644 --- a/api-generator/components/tieredmenu.js +++ b/api-generator/components/tieredmenu.js @@ -41,6 +41,10 @@ const TieredMenuSlots = [ { name: 'item', description: 'Template of a menuitem.' + }, + { + name: 'submenuicon', + description: 'Custom submenu icon template.' } ]; diff --git a/components/lib/tieredmenu/TieredMenu.d.ts b/components/lib/tieredmenu/TieredMenu.d.ts index aa13d9d98..a7edfd7c3 100755 --- a/components/lib/tieredmenu/TieredMenu.d.ts +++ b/components/lib/tieredmenu/TieredMenu.d.ts @@ -77,6 +77,15 @@ export interface TieredMenuSlots { */ item: MenuItem; }): VNode[]; + /** + * Custom submenu icon template. + */ + submenuicon(scope: { + /** + * Whether item is active + */ + active: boolean; + }): VNode[]; } /** diff --git a/components/lib/tieredmenu/TieredMenu.vue b/components/lib/tieredmenu/TieredMenu.vue index 68100a480..255056b68 100755 --- a/components/lib/tieredmenu/TieredMenu.vue +++ b/components/lib/tieredmenu/TieredMenu.vue @@ -16,7 +16,7 @@ :menuId="id" :focusedItemId="focused ? focusedItemId : undefined" :items="processedItems" - :template="$slots.item" + :template="$slots" :activeItemPath="activeItemPath" :exact="exact" :level="0" diff --git a/components/lib/tieredmenu/TieredMenuSub.vue b/components/lib/tieredmenu/TieredMenuSub.vue index 3214ba1e4..7c26fc64e 100755 --- a/components/lib/tieredmenu/TieredMenuSub.vue +++ b/components/lib/tieredmenu/TieredMenuSub.vue @@ -16,7 +16,7 @@ :aria-posinset="getAriaPosInset(index)" >
-