src/layout/components/Sidebar/index.vue
@@ -58,6 +58,7 @@ 'sidebar' ]), routes() { // 接口中的返回值 进行格式化 const newCodeArr = [] const newCodeNameArr = [] this.routers.forEach(item => { @@ -74,6 +75,8 @@ } } }) // 本地路由与 接口中的返回值进行匹配,有相同code的值进行push const arr = this.$router.options.routes const arr2 = [] arr.forEach((item, index) => { @@ -100,7 +103,9 @@ arr2.push(item) } }) return arr2 // return arr }, activeMenu() { const route = this.$route