修改方法
在src/layout/components/Sidebar/SidebarItem.vue
<sidebar-item v-for="route in permission_routers" :key="route.path" :item="route" :base-path="route.path" />
改成
<sidebar-item v-for="(route,index) in permission_routers" :key="index+route.path" :item="route" :base-path="route.path" />
这样避免key重复,
也可以把'重复的原因'中的路由地址改成不一样的,但是这样改回造成同一个页面开出两个子菜单
重复的原因
圈起来这俩相同会报错