loulijun2021
2022-06-25 e846eefa54a7a2274a34d43d4601e192a1ada3d9
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