在Vue中获取v-for的index值
<el-submenu :index="item.id+''" v-for="(item,index) in menuList" :key="item.id"><template slot="title"><i :class="icons[index]"></i><span>{{item.authName}}</span>&l
·
<el-submenu :index="item.id+''" v-for="(item,index) in menuList" :key="item.id">
<template slot="title">
<i :class="icons[index]"></i>
<span>{{item.authName}}</span>
</template>
data() {
return {
icons: ['el-icon-s-custom', 'el-icon-s-claim', 'el-icon-s-goods', 'el-icon-s-order', 'el-icon-s-data']
}
v-for="(item,index) in menuList"
更多推荐
已为社区贡献4条内容
所有评论(0)