Browse Source

修改 新增菜单后无法正常展示tab bug!

daxiongYang 7 years ago
parent
commit
7eceb86deb
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/views/layout/sidebar.vue

+ 3 - 1
src/views/layout/sidebar.vue

@ -84,13 +84,15 @@
84 84
      },
85 85
      // 获取菜单导航, 根据路由名称
86 86
      getMenuNavByRouteName (name, menuNavList) {
87
        var temp = []
87 88
        for (var i = 0; i < menuNavList.length; i++) {
88 89
          if (menuNavList[i].list && menuNavList[i].list.length >= 1) {
89
            return this.getMenuNavByRouteName(name, menuNavList[i].list)
90
            temp = temp.concat(menuNavList[i].list)
90 91
          } else if (getRouteNameByUrl(menuNavList[i].url) === name) {
91 92
            return menuNavList[i]
92 93
          }
93 94
        }
95
        return temp.length >= 1 ? this.getMenuNavByRouteName(name, temp) : []
94 96
      },
95 97
      ...mapMutations(['UPDATE_MENU_NAV_LIST', 'ADD_CONTENT_TAB', 'UPDATE_CONTENT_TABS_ACTIVE_NAME'])
96 98
    }