diff --git a/mock/role/routes.js b/mock/role/routes.js index 62a09d01..5bb6c741 100644 --- a/mock/role/routes.js +++ b/mock/role/routes.js @@ -129,7 +129,7 @@ export const asyncRoutes = [ { path: '/components', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ComponentDemo', meta: { title: 'components', @@ -225,7 +225,7 @@ export const asyncRoutes = [ { path: '/charts', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', name: 'Charts', meta: { title: 'charts', @@ -361,7 +361,7 @@ export const asyncRoutes = [ { path: '/error', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ErrorPages', meta: { title: 'errorPages', @@ -386,7 +386,7 @@ export const asyncRoutes = [ { path: '/error-log', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', children: [ { path: 'log', @@ -472,7 +472,7 @@ export const asyncRoutes = [ { path: '/theme', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', children: [ { path: 'index', @@ -486,7 +486,7 @@ export const asyncRoutes = [ { path: '/clipboard', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', children: [ { path: 'index', diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index ff93ff45..1ea13031 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -2,7 +2,7 @@ - {{ + {{ generateTitle(item.meta.title) }} {{ generateTitle(item.meta.title) }} @@ -31,6 +31,7 @@ export default { methods: { generateTitle, getBreadcrumb() { + // only show routes with name let matched = this.$route.matched.filter(item => item.name) const first = matched[0] diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue index 6668ad5c..90eea067 100644 --- a/src/components/HeaderSearch/index.vue +++ b/src/components/HeaderSearch/index.vue @@ -121,7 +121,7 @@ export default { data.title = [...data.title, i18ntitle] - if (router.redirect !== 'noredirect') { + if (router.redirect !== 'noRedirect') { // only push the routes with title // special case: need to exclude parent router without redirect res.push(data) diff --git a/src/router/index.js b/src/router/index.js index d04a64be..0c5973da 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,7 +20,7 @@ import nestedRouter from './modules/nested' * alwaysShow: true if set true, will always show the root menu * if not set alwaysShow, when item has more than one children route, * it will becomes nested mode, otherwise not show the root menu - * redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb + * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb * name:'router-name' the name is used by (must set!!!) * meta : { roles: ['admin','editor'] control the page roles (you can set multiple roles) @@ -224,7 +224,7 @@ export const asyncRoutes = [ { path: '/error', component: Layout, - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ErrorPages', meta: { title: 'errorPages', @@ -249,7 +249,6 @@ export const asyncRoutes = [ { path: '/error-log', component: Layout, - redirect: 'noredirect', children: [ { path: 'log', @@ -336,7 +335,6 @@ export const asyncRoutes = [ { path: '/theme', component: Layout, - redirect: 'noredirect', children: [ { path: 'index', @@ -350,7 +348,6 @@ export const asyncRoutes = [ { path: '/clipboard', component: Layout, - redirect: 'noredirect', children: [ { path: 'index', diff --git a/src/router/modules/charts.js b/src/router/modules/charts.js index 5797ba04..59ebf188 100644 --- a/src/router/modules/charts.js +++ b/src/router/modules/charts.js @@ -5,7 +5,7 @@ import Layout from '@/layout' const chartsRouter = { path: '/charts', component: Layout, - redirect: 'noredirect', + redirect: 'noRedirect', name: 'Charts', meta: { title: 'charts', diff --git a/src/router/modules/components.js b/src/router/modules/components.js index 0d8055bd..b7407e25 100644 --- a/src/router/modules/components.js +++ b/src/router/modules/components.js @@ -5,7 +5,7 @@ import Layout from '@/layout' const componentsRouter = { path: '/components', component: Layout, - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ComponentDemo', meta: { title: 'components',