Skip to content

Commit 4ee334a

Browse files
committed
perf[Breadcrumb]: set noredirect => noRedirect
1 parent 067a291 commit 4ee334a

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

mock/role/routes.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export const asyncRoutes = [
129129
{
130130
path: '/components',
131131
component: 'layout/Layout',
132-
redirect: 'noredirect',
132+
redirect: 'noRedirect',
133133
name: 'ComponentDemo',
134134
meta: {
135135
title: 'components',
@@ -225,7 +225,7 @@ export const asyncRoutes = [
225225
{
226226
path: '/charts',
227227
component: 'layout/Layout',
228-
redirect: 'noredirect',
228+
redirect: 'noRedirect',
229229
name: 'Charts',
230230
meta: {
231231
title: 'charts',
@@ -361,7 +361,7 @@ export const asyncRoutes = [
361361
{
362362
path: '/error',
363363
component: 'layout/Layout',
364-
redirect: 'noredirect',
364+
redirect: 'noRedirect',
365365
name: 'ErrorPages',
366366
meta: {
367367
title: 'errorPages',
@@ -386,7 +386,7 @@ export const asyncRoutes = [
386386
{
387387
path: '/error-log',
388388
component: 'layout/Layout',
389-
redirect: 'noredirect',
389+
redirect: 'noRedirect',
390390
children: [
391391
{
392392
path: 'log',
@@ -472,7 +472,7 @@ export const asyncRoutes = [
472472
{
473473
path: '/theme',
474474
component: 'layout/Layout',
475-
redirect: 'noredirect',
475+
redirect: 'noRedirect',
476476
children: [
477477
{
478478
path: 'index',
@@ -486,7 +486,7 @@ export const asyncRoutes = [
486486
{
487487
path: '/clipboard',
488488
component: 'layout/Layout',
489-
redirect: 'noredirect',
489+
redirect: 'noRedirect',
490490
children: [
491491
{
492492
path: 'index',

src/components/Breadcrumb/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<el-breadcrumb class="app-breadcrumb" separator="/">
33
<transition-group name="breadcrumb">
44
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
5-
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{
5+
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{
66
generateTitle(item.meta.title) }}</span>
77
<a v-else @click.prevent="handleLink(item)">{{ generateTitle(item.meta.title) }}</a>
88
</el-breadcrumb-item>
@@ -31,6 +31,7 @@ export default {
3131
methods: {
3232
generateTitle,
3333
getBreadcrumb() {
34+
// only show routes with name
3435
let matched = this.$route.matched.filter(item => item.name)
3536
3637
const first = matched[0]

src/components/HeaderSearch/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default {
121121
122122
data.title = [...data.title, i18ntitle]
123123
124-
if (router.redirect !== 'noredirect') {
124+
if (router.redirect !== 'noRedirect') {
125125
// only push the routes with title
126126
// special case: need to exclude parent router without redirect
127127
res.push(data)

src/router/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import nestedRouter from './modules/nested'
2020
* alwaysShow: true if set true, will always show the root menu
2121
* if not set alwaysShow, when item has more than one children route,
2222
* it will becomes nested mode, otherwise not show the root menu
23-
* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
23+
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
2424
* name:'router-name' the name is used by <keep-alive> (must set!!!)
2525
* meta : {
2626
roles: ['admin','editor'] control the page roles (you can set multiple roles)
@@ -224,7 +224,7 @@ export const asyncRoutes = [
224224
{
225225
path: '/error',
226226
component: Layout,
227-
redirect: 'noredirect',
227+
redirect: 'noRedirect',
228228
name: 'ErrorPages',
229229
meta: {
230230
title: 'errorPages',
@@ -249,7 +249,6 @@ export const asyncRoutes = [
249249
{
250250
path: '/error-log',
251251
component: Layout,
252-
redirect: 'noredirect',
253252
children: [
254253
{
255254
path: 'log',
@@ -336,7 +335,6 @@ export const asyncRoutes = [
336335
{
337336
path: '/theme',
338337
component: Layout,
339-
redirect: 'noredirect',
340338
children: [
341339
{
342340
path: 'index',
@@ -350,7 +348,6 @@ export const asyncRoutes = [
350348
{
351349
path: '/clipboard',
352350
component: Layout,
353-
redirect: 'noredirect',
354351
children: [
355352
{
356353
path: 'index',

src/router/modules/charts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Layout from '@/layout'
55
const chartsRouter = {
66
path: '/charts',
77
component: Layout,
8-
redirect: 'noredirect',
8+
redirect: 'noRedirect',
99
name: 'Charts',
1010
meta: {
1111
title: 'charts',

src/router/modules/components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Layout from '@/layout'
55
const componentsRouter = {
66
path: '/components',
77
component: Layout,
8-
redirect: 'noredirect',
8+
redirect: 'noRedirect',
99
name: 'ComponentDemo',
1010
meta: {
1111
title: 'components',

0 commit comments

Comments
 (0)