From 74cf24de46b45fbbd19f883d11f9f30c24b9f0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com> Date: Wed, 24 Jan 2018 22:36:35 +0800 Subject: [PATCH] no message Former-commit-id: a3914676bf049f656d39d61ee3c897b26a4b6f64 Former-commit-id: 7b6fc910e67a34ce4fa7a87616fdfdaf31e1ee35 Former-commit-id: 87143223df215aadaee67363026fbec0943ff72c --- src/components/core/MainLayout/_headerMenu.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/core/MainLayout/_headerMenu.vue b/src/components/core/MainLayout/_headerMenu.vue index ea3f6f8b..d2c3b953 100644 --- a/src/components/core/MainLayout/_headerMenu.vue +++ b/src/components/core/MainLayout/_headerMenu.vue @@ -27,22 +27,22 @@ export default { return this.$route.name }, // 不管当前路由是不是顶级菜单 都返回这个路由所属的顶级菜单对象的name - // 如果返回 undefined 代表这个路由不是在菜单里显示的路由 + // 如果返回 null 代表这个路由不是在菜单里显示的路由 routeTopLevelName () { if (this.router.find(e => e.name === this.routeName)) { return this.routeName } else { const find = this.router.find(e => e.children.find(child => child.name === this.routeName)) - return find ? find.name : undefined + return find ? find.name : null } }, - // 返回当前对象对应的顶级菜单 这个菜单可以在侧边栏菜单中直接使用 - // 如果返回 undefined 代表这个路由没有对应的一级路由也就没有菜单 + // 返回当前对象对应的顶级菜单下的所有子菜单 这些菜单可以在侧边栏菜单中直接使用 + // 如果返回 null 代表这个路由没有对应的一级路由也就没有菜单 routeTopLevelMenu () { if (this.routeTopLevelName) { return this.menu.find(e => e.name === this.routeTopLevelName).children } else { - return undefined + return null } } },