Fixed #4779 - PanelMenu: root option for item templating
parent
5c6ffcc482
commit
466597181a
|
@ -296,6 +296,10 @@ export interface PanelMenuSlots {
|
|||
* Menuitem instance
|
||||
*/
|
||||
item: MenuItem;
|
||||
/**
|
||||
* Whether there is a root menuitem
|
||||
*/
|
||||
root: boolean;
|
||||
/**
|
||||
* Current active state of the menuitem
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<span :class="cx('headerLabel')" v-bind="getPTOptions('headerLabel', item, index)">{{ getItemLabel(item) }}</span>
|
||||
</a>
|
||||
</template>
|
||||
<component v-else :is="$slots.item" :item="item" :isActive="isItemActive(item)" :hasSubmenu="getItemProp(item, 'items')" :label="getItemLabel(item)" :props="getMenuItemProps(item, index)"></component>
|
||||
<component v-else :is="$slots.item" :item="item" :root="true" :isActive="isItemActive(item)" :hasSubmenu="getItemProp(item, 'items')" :label="getItemLabel(item)" :props="getMenuItemProps(item, index)"></component>
|
||||
</div>
|
||||
</div>
|
||||
<transition name="p-toggleable-content" v-bind="ptm('transition')">
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
v-else
|
||||
:is="templates.item"
|
||||
:item="processedItem.item"
|
||||
:root="false"
|
||||
:isActive="isItemActive(processedItem)"
|
||||
:hasSubmenu="isItemGroup(processedItem)"
|
||||
:label="getItemLabel(processedItem)"
|
||||
|
|
Loading…
Reference in New Issue