pull/4649/head
Tuğçe Küçükoğlu 2023-10-17 12:55:48 +03:00
parent 925a065bfa
commit e8acbefd2a
2 changed files with 26 additions and 1 deletions

View File

@ -228,6 +228,14 @@ export interface PanelMenuRouterBindProps {
* Submenuicon elemnt binding * Submenuicon elemnt binding
*/ */
submenuicon: object; submenuicon: object;
/**
* Header icon element binding
*/
headerIcon: object;
/**
* Header label element binding
*/
headerLabel: object;
} }
/** /**

View File

@ -35,7 +35,7 @@
<span :class="cx('headerLabel')" v-bind="getPTOptions('headerLabel', item, index)">{{ getItemLabel(item) }}</span> <span :class="cx('headerLabel')" v-bind="getPTOptions('headerLabel', item, index)">{{ getItemLabel(item) }}</span>
</a> </a>
</template> </template>
<component v-else :is="$slots.item" :item="item"></component> <component v-else :is="$slots.item" :item="item" :hasSubmenu="getItemProp(item, 'items')" :label="getItemLabel(item)" :props="getMenuItemProps(item, index)"></component>
</div> </div>
</div> </div>
<transition name="p-toggleable-content" v-bind="ptm('transition')"> <transition name="p-toggleable-content" v-bind="ptm('transition')">
@ -64,6 +64,7 @@
import ChevronDownIcon from 'primevue/icons/chevrondown'; import ChevronDownIcon from 'primevue/icons/chevrondown';
import ChevronRightIcon from 'primevue/icons/chevronright'; import ChevronRightIcon from 'primevue/icons/chevronright';
import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils'; import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils';
import { mergeProps } from 'vue';
import BasePanelMenu from './BasePanelMenu.vue'; import BasePanelMenu from './BasePanelMenu.vue';
import PanelMenuList from './PanelMenuList.vue'; import PanelMenuList from './PanelMenuList.vue';
@ -248,6 +249,22 @@ export default {
}, },
changeFocusedHeader(event, element) { changeFocusedHeader(event, element) {
element && DomHandler.focus(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: { components: {