pull/6188/merge
tugcekucukoglu 2024-11-21 11:48:38 +03:00
parent a7bf69c4ff
commit 70f90968c6
1 changed files with 6 additions and 3 deletions

View File

@ -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" :root="true" :active="isItemActive(item)" :hasSubmenu="getItemProp(item, 'items')" :label="getItemLabel(item)" :props="getMenuItemProps(item, index)"></component> <component v-else :is="$slots.item" :item="item" :root="true" :active="isItemActive(item)" :hasSubmenu="isItemGroup(item)" :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')">
@ -53,9 +53,9 @@
</template> </template>
<script> <script>
import { findSingle, focus, getAttribute } from '@primeuix/utils/dom';
import { equals, isNotEmpty, resolve } from '@primeuix/utils/object';
import { UniqueComponentId } from '@primevue/core/utils'; import { UniqueComponentId } from '@primevue/core/utils';
import { focus, getAttribute, findSingle } from '@primeuix/utils/dom';
import { equals, resolve } from '@primeuix/utils/object';
import ChevronDownIcon from '@primevue/icons/chevrondown'; import ChevronDownIcon from '@primevue/icons/chevrondown';
import ChevronRightIcon from '@primevue/icons/chevronright'; import ChevronRightIcon from '@primevue/icons/chevronright';
import { mergeProps } from 'vue'; import { mergeProps } from 'vue';
@ -111,6 +111,9 @@ export default {
isItemFocused(item) { isItemFocused(item) {
return equals(item, this.activeItem); return equals(item, this.activeItem);
}, },
isItemGroup(item) {
return isNotEmpty(item.items);
},
getPanelId(index) { getPanelId(index) {
return `${this.id}_${index}`; return `${this.id}_${index}`;
}, },