<transition-group name="breadcrumb"> <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.title" v-if='item.title'> <span v-if='item.redirect==="noredirect"||index==levelList.length-1' class="no-redirect">{{ item.title }}</span> <router-link v-else :to="item.redirect||item.path">{{ item.title }}</router-link> </el-breadcrumb-item> </transition-group>
注意:
这里的 <transition-group> 的子元素不能使用 v-for 的index当做key
(Emitted value instead of an instance of Error) Do not use v-for index as key on
<transition-group> children, this is the same as not using keys.