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