在进行Web前端开发使用elementUI时,因为el-menu-item是动态加载的,不是页面写死,进行(item,index) in array 遍历动态设置el-menu-item的index时,一直提示Invalid prop: custom validator check failed for prop "index",并且选中状态不正确显示!
从提示上来看,就是检测的类型不匹配,经过查阅官方文档给出的demo:el-menu-item的index为string类型,不是int类型!
<el-menu :router="true" mode="horizontal" background-color="#1c213f" text-color="#fff">
<el-submenu index="1">
<template slot="title">
<i class="el-icon-menu"></i>
</t