Fixed #4764 - ContextMenu: hasSubmenu options for item templating

pull/4767/head
tugcekucukoglu 2023-11-07 09:40:48 +03:00
parent 01af58f917
commit a59b595334
2 changed files with 5 additions and 1 deletions

View File

@ -290,6 +290,10 @@ export interface ContextMenuSlots {
* Label property of the menuitem
*/
label: string | ((...args: any) => string) | undefined;
/**
* Whether or not there is a submenu
*/
hasSubmenu: boolean;
/**
* Binding properties of the menuitem
*/

View File

@ -39,7 +39,7 @@
</template>
</a>
</template>
<component v-else :is="templates.item" :item="processedItem.item" :label="getItemLabel(processedItem)" :props="getMenuItemProps(processedItem, index)"></component>
<component v-else :is="templates.item" :item="processedItem.item" :hasSubmenu="getItemProp(processedItem, 'items')" :label="getItemLabel(processedItem)" :props="getMenuItemProps(processedItem, index)"></component>
</div>
<ContextMenuSub
v-if="isItemVisible(processedItem) && isItemGroup(processedItem)"