From f876b9b67876b82dfda61aa85a408785e8ffb3ef Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 24 Nov 2017 15:35:38 +0800 Subject: [PATCH] perf:refine breadcrumb --- src/components/Breadcrumb/index.vue | 6 +----- src/router/index.js | 9 +++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 86fe9a36..20ef826a 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -22,13 +22,9 @@ export default { methods: { getBreadcrumb() { let matched = this.$route.matched.filter(item => item.name) - if (matched.length === 0) { - this.levelList = [{ path: '/', meta: { title: '首页' }}] - return - } const first = matched[0] if (first && first.name !== 'dashboard') { - matched = [{ path: '/', meta: { title: 'dashboard' }}].concat(matched) + matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched) } this.levelList = matched }, diff --git a/src/router/index.js b/src/router/index.js index 868e7981..26c47f4a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -87,6 +87,7 @@ export const asyncRouterMap = [ { path: '/components', component: Layout, + redirect: 'noredirect', name: 'component-demo', meta: { title: 'components', @@ -110,7 +111,7 @@ export const asyncRouterMap = [ { path: '/charts', component: Layout, - redirect: '/charts/index', + redirect: 'noredirect', name: 'charts', meta: { title: 'charts', @@ -126,7 +127,7 @@ export const asyncRouterMap = [ { path: '/example', component: Layout, - redirect: 'noredirect', + redirect: '/example/table/complex-table', name: 'example', meta: { title: 'example', @@ -136,7 +137,7 @@ export const asyncRouterMap = [ { path: '/example/table', component: _import('example/table/index'), - redirect: '/example/table/table', + redirect: '/example/table/complex-table', name: 'Table', meta: { title: 'Table', @@ -193,7 +194,7 @@ export const asyncRouterMap = [ { path: '/excel', component: Layout, - redirect: '/excel/download', + redirect: '/excel/export-excel', name: 'excel', meta: { title: 'excel',