mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #4351 - For Menu
This commit is contained in:
parent
c57faf3db1
commit
ba6ed5461d
2 changed files with 32 additions and 2 deletions
|
@ -22,7 +22,7 @@
|
|||
<template v-for="(item, i) of model" :key="label(item) + i.toString()">
|
||||
<template v-if="item.items && visible(item) && !item.separator">
|
||||
<li v-if="item.items" :id="id + '_' + i" :class="cx('submenuHeader')" role="none" v-bind="ptm('submenuHeader')">
|
||||
<slot name="item" :item="item">{{ label(item) }}</slot>
|
||||
<slot name="submenuheader" :item="item">{{ label(item) }}</slot>
|
||||
</li>
|
||||
<template v-for="(child, j) of item.items" :key="child.label + i + '_' + j">
|
||||
<PVMenuitem v-if="visible(child) && !child.separator" :id="id + '_' + i + '_' + j" :item="child" :templates="$slots" :exact="exact" :focusedOptionId="focusedOptionId" @item-click="itemClick" :pt="pt" />
|
||||
|
@ -73,6 +73,11 @@ export default {
|
|||
resizeListener: null,
|
||||
container: null,
|
||||
list: null,
|
||||
beforeMount() {
|
||||
if (!this.$slots.item) {
|
||||
console.warn('In future versions, vue-router support will be removed. Item templating should be used.');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.id = this.id || UniqueComponentId();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue