Menu item icon slot added

pull/4339/head
Bahadır Sofuoğlu 2023-08-28 16:29:49 +03:00
parent 66d93651b9
commit a75e7c6bc8
3 changed files with 19 additions and 1 deletions

View File

@ -137,6 +137,10 @@ const SplitButtonSlots = [
{
name: 'menubuttonicon',
description: 'Custom menu button icon template.'
},
{
name: 'menuitemicon',
description: 'Custom menu item icon template.'
}
];

View File

@ -205,6 +205,16 @@ export interface SplitButtonSlots {
*/
class: string;
}): VNode[];
/**
* Custom menu item icon template.
* @param {Object} scope - menubuttonicon slot's params.
*/
menuitemicon(scope: {
/**
* Menuitem instance
*/
item: MenuItem;
}): VNode[];
}
/**

View File

@ -49,7 +49,11 @@
</slot>
</template>
</PVSButton>
<PVSMenu ref="menu" :id="ariaId + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" :unstyled="unstyled" :pt="ptm('menu')" />
<PVSMenu ref="menu" :id="ariaId + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" :unstyled="unstyled" :pt="ptm('menu')">
<template v-if="$slots.menuitemicon" #itemicon="slotProps">
<slot name="menuitemicon" :item="slotProps.item" />
</template>
</PVSMenu>
</div>
</template>