Skip to content

Commit f876b9b

Browse files
committed
perf:refine breadcrumb
1 parent 061fa1f commit f876b9b

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/components/Breadcrumb/index.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@ export default {
2222
methods: {
2323
getBreadcrumb() {
2424
let matched = this.$route.matched.filter(item => item.name)
25-
if (matched.length === 0) {
26-
this.levelList = [{ path: '/', meta: { title: '首页' }}]
27-
return
28-
}
2925
const first = matched[0]
3026
if (first && first.name !== 'dashboard') {
31-
matched = [{ path: '/', meta: { title: 'dashboard' }}].concat(matched)
27+
matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched)
3228
}
3329
this.levelList = matched
3430
},

src/router/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export const asyncRouterMap = [
8787
{
8888
path: '/components',
8989
component: Layout,
90+
redirect: 'noredirect',
9091
name: 'component-demo',
9192
meta: {
9293
title: 'components',
@@ -110,7 +111,7 @@ export const asyncRouterMap = [
110111
{
111112
path: '/charts',
112113
component: Layout,
113-
redirect: '/charts/index',
114+
redirect: 'noredirect',
114115
name: 'charts',
115116
meta: {
116117
title: 'charts',
@@ -126,7 +127,7 @@ export const asyncRouterMap = [
126127
{
127128
path: '/example',
128129
component: Layout,
129-
redirect: 'noredirect',
130+
redirect: '/example/table/complex-table',
130131
name: 'example',
131132
meta: {
132133
title: 'example',
@@ -136,7 +137,7 @@ export const asyncRouterMap = [
136137
{
137138
path: '/example/table',
138139
component: _import('example/table/index'),
139-
redirect: '/example/table/table',
140+
redirect: '/example/table/complex-table',
140141
name: 'Table',
141142
meta: {
142143
title: 'Table',
@@ -193,7 +194,7 @@ export const asyncRouterMap = [
193194
{
194195
path: '/excel',
195196
component: Layout,
196-
redirect: '/excel/download',
197+
redirect: '/excel/export-excel',
197198
name: 'excel',
198199
meta: {
199200
title: 'excel',

0 commit comments

Comments
 (0)