Fixed #3393 - TabMenu: index of menu item must be accessible in slot

pull/3509/head
Tuğçe Küçükoğlu 2023-01-09 13:22:08 +03:00
parent a287b092c1
commit e8714865c0
2 changed files with 6 additions and 3 deletions

View File

@ -21,7 +21,7 @@
<span class="p-menuitem-text">{{ label(item) }}</span>
</a>
</template>
<component v-else :is="$slots.item" :item="item"></component>
<component v-else :is="$slots.item" :item="item" :index="i"></component>
</li>
</router-link>
<li v-else-if="visible(item)" ref="tab" :class="getItemClass(item, i)" role="presentation" @click="onItemClick($event, item, i)" @keydown="onKeydownItem($event, item, i)">
@ -31,7 +31,7 @@
<span class="p-menuitem-text">{{ label(item) }}</span>
</a>
</template>
<component v-else :is="$slots.item" :item="item"></component>
<component v-else :is="$slots.item" :item="item" :index="i"></component>
</li>
</template>
<li ref="inkbar" class="p-tabmenu-ink-bar"></li>

View File

@ -159,7 +159,10 @@ export default {
<tbody>
<tr>
<td>item</td>
<td>item: Menuitem instance</td>
<td>
item: Menuitem instance<br />
index: Index of the menuitem instance
</td>
</tr>
</tbody>
</table>