From e8acbefd2aaaa92d584a8a835c1abe3964ff53f1 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: Tue, 17 Oct 2023 12:55:48 +0300 Subject: [PATCH] Fixed #4616 --- components/lib/panelmenu/PanelMenu.d.ts | 8 ++++++++ components/lib/panelmenu/PanelMenu.vue | 19 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/components/lib/panelmenu/PanelMenu.d.ts b/components/lib/panelmenu/PanelMenu.d.ts index d713bafd1..ccd3967f5 100755 --- a/components/lib/panelmenu/PanelMenu.d.ts +++ b/components/lib/panelmenu/PanelMenu.d.ts @@ -228,6 +228,14 @@ export interface PanelMenuRouterBindProps { * Submenuicon elemnt binding */ submenuicon: object; + /** + * Header icon element binding + */ + headerIcon: object; + /** + * Header label element binding + */ + headerLabel: object; } /** diff --git a/components/lib/panelmenu/PanelMenu.vue b/components/lib/panelmenu/PanelMenu.vue index a7889a6a5..4ab53e720 100644 --- a/components/lib/panelmenu/PanelMenu.vue +++ b/components/lib/panelmenu/PanelMenu.vue @@ -35,7 +35,7 @@ {{ getItemLabel(item) }} - + @@ -64,6 +64,7 @@ import ChevronDownIcon from 'primevue/icons/chevrondown'; import ChevronRightIcon from 'primevue/icons/chevronright'; import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils'; +import { mergeProps } from 'vue'; import BasePanelMenu from './BasePanelMenu.vue'; import PanelMenuList from './PanelMenuList.vue'; @@ -248,6 +249,22 @@ export default { }, changeFocusedHeader(event, element) { element && DomHandler.focus(element); + }, + getMenuItemProps(item, index) { + return { + icon: mergeProps( + { + class: [this.cx('headerIcon'), this.getItemProp(item, 'icon')] + }, + this.getPTOptions('headerIcon', item, index) + ), + label: mergeProps( + { + class: this.cx('headerLabel') + }, + this.getPTOptions('headerLabel', processedItem, index) + ) + }; } }, components: {