mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 09:22:34 +00:00
parent
2f777041e5
commit
f54ea1f777
4 changed files with 26 additions and 8 deletions
|
@ -16,20 +16,20 @@
|
|||
:aria-posinset="getAriaPosInset(index)"
|
||||
>
|
||||
<div class="p-menuitem-content" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)">
|
||||
<template v-if="!template.item">
|
||||
<template v-if="!templates.item">
|
||||
<router-link v-if="getItemProp(processedItem, 'to') && !isItemDisabled(processedItem)" v-slot="{ navigate, href, isActive, isExactActive }" :to="getItemProp(processedItem, 'to')" custom>
|
||||
<a v-ripple :href="href" :class="getItemActionClass(processedItem, { isActive, isExactActive })" tabindex="-1" aria-hidden="true" @click="onItemActionClick($event, navigate)">
|
||||
<span v-if="getItemProp(processedItem, 'icon')" :class="getItemIconClass(processedItem)"></span>
|
||||
<component :is="templates.itemicon || (getItemProp(processedItem, 'icon') ? 'span' : undefined)" :item="processedItem.item" :class="getItemIconClass(processedItem)" />
|
||||
<span class="p-menuitem-text">{{ getItemLabel(processedItem) }}</span>
|
||||
</a>
|
||||
</router-link>
|
||||
<a v-else v-ripple :href="getItemProp(processedItem, 'url')" :class="getItemActionClass(processedItem)" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true">
|
||||
<span v-if="getItemProp(processedItem, 'icon')" :class="getItemIconClass(processedItem)"></span>
|
||||
<component :is="templates.itemicon || (getItemProp(processedItem, 'icon') ? 'span' : undefined)" :item="processedItem.item" :class="getItemIconClass(processedItem)" />
|
||||
<span class="p-menuitem-text">{{ getItemLabel(processedItem) }}</span>
|
||||
<component v-if="getItemProp(processedItem, 'items')" :is="template.submenuicon || (root ? 'AngleDownIcon' : 'AngleRightIcon')" :root="root" :active="isItemActive(processedItem)" class="p-submenu-icon" />
|
||||
<component v-if="getItemProp(processedItem, 'items')" :is="templates.submenuicon || (root ? 'AngleDownIcon' : 'AngleRightIcon')" :root="root" :active="isItemActive(processedItem)" class="p-submenu-icon" />
|
||||
</a>
|
||||
</template>
|
||||
<component v-else :is="template.item" :item="processedItem.item"></component>
|
||||
<component v-else :is="templates.item" :item="processedItem.item"></component>
|
||||
</div>
|
||||
<MenubarSub
|
||||
v-if="isItemVisible(processedItem) && isItemGroup(processedItem)"
|
||||
|
@ -40,7 +40,7 @@
|
|||
:items="processedItem.items"
|
||||
:mobileActive="mobileActive"
|
||||
:activeItemPath="activeItemPath"
|
||||
:template="template"
|
||||
:templates="templates"
|
||||
:exact="exact"
|
||||
:level="level + 1"
|
||||
@item-click="$emit('item-click', $event)"
|
||||
|
@ -78,7 +78,7 @@ export default {
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
template: {
|
||||
templates: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue