hejianhao
2025-04-02 4a4e1253e9057dc9e01e6178ea37e5ed2a76ad7f
src/layouts/components/ElMenu/index.vue
@@ -29,8 +29,12 @@
  },
  mounted() {
    // 获取所有定义的一级菜单和多级菜单
    // 过滤掉登录路由,只获取主布局下的路由
    this.routersList = routers.options.routes.find(route => route.path === '/').children;
    // 过滤掉登录路由和重定向路由,只获取主布局下的路由
    this.routersList = routers.options.routes.filter(route =>
      route.path !== '/login' &&
      route.path !== '/' &&
      !route.meta?.hide
    );
  },
};
</script>