Fixed #959 - Add keys to template v-for

This commit is contained in:
Cagatay Civici 2021-02-10 13:29:37 +03:00
parent 3bd70d34c1
commit 8041a244ab
10 changed files with 58 additions and 173 deletions

View file

@ -1,7 +1,7 @@
<template>
<ul class="p-submenu-list" role="tree">
<template v-for="(item, i) of model">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator" :key="item.label + i">
<template v-for="(item, i) of model" :key="item.label + i">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator">
<router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}">
<a :href="href" :class="getLinkClass(item)" @click="onItemClick($event, item, navigate)" role="treeitem" :aria-expanded="isActive(item)">
<span :class="['p-menuitem-icon', item.icon]"></span>