diff --git a/src/libs/util.js b/src/libs/util.js index a74a1e5d2..d76efeca7 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -57,7 +57,7 @@ export const getBreadCrumbList = (route, homeRoute) => { let routeMetched = route.matched if (routeMetched.some(item => item.name === homeRoute.name)) return [homeItem] let res = routeMetched.filter(item => { - return item.meta === undefined || !item.meta.hide + return item.meta === undefined || !item.meta.hideInBread }).map(item => { let meta = {...item.meta} if (meta.title && typeof meta.title === 'function') meta.title = meta.title(route) @@ -89,6 +89,7 @@ export const getRouteTitleHandled = (route) => { export const showTitle = (item, vm) => { let title = item.meta.title + if (!title) return if (vm.$config.useI18n) { if (title.includes('{{') && title.includes('}}') && vm.$config.useI18n) title = title.replace(/({{[\s\S]+?}})/, (m, str) => str.replace(/{{([\s\S]*)}}/, (m, _) => vm.$t(_.trim()))) else title = vm.$t(item.name) diff --git a/src/router/routers.js b/src/router/routers.js index 3f81176be..eb69d4594 100644 --- a/src/router/routers.js +++ b/src/router/routers.js @@ -8,6 +8,7 @@ import parentView from '@/components/parent-view' * 显示在侧边栏、面包屑和标签栏的文字 * 使用'{{ 多语言字段 }}'形式结合多语言使用,例子看多语言的路由配置; * 可以传入一个回调函数,参数是当前路由对象,例子看动态路由和带参路由 + * hideInBread: (false) 设为true后此级路由将不会出现在面包屑中,示例看QQ群路由配置 * hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项 * notCache: (false) 设为true后页面不会缓存 * access: (null) 可访问该页面的权限数组,当前路由设置的权限会影响子路由 @@ -62,6 +63,9 @@ export default [ path: '/join', name: 'join', component: Main, + meta: { + hideInBread: true + }, children: [ { path: 'join_page', @@ -210,7 +214,7 @@ export default [ path: '/tools_methods', name: 'tools_methods', meta: { - hide: true + hideInBread: true }, component: Main, children: [ @@ -230,7 +234,7 @@ export default [ path: '/i18n', name: 'i18n', meta: { - hide: true + hideInBread: true }, component: Main, children: [ @@ -249,7 +253,7 @@ export default [ path: '/error_store', name: 'error_store', meta: { - hide: true + hideInBread: true }, component: Main, children: [ @@ -268,7 +272,7 @@ export default [ path: '/error_logger', name: 'error_logger', meta: { - hide: true, + hideInBread: true, hideInMenu: true }, component: Main, @@ -288,7 +292,7 @@ export default [ path: '/directive', name: 'directive', meta: { - hide: true + hideInBread: true }, component: Main, children: [