File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/components/Breadcrumb Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -31,16 +31,23 @@ export default {
31
31
methods: {
32
32
generateTitle,
33
33
getBreadcrumb () {
34
- // only show routes with name
35
- let matched = this .$route .matched .filter (item => item .name )
36
-
34
+ // only show routes with meta.title
35
+ let matched = this .$route .matched .filter (item => item .meta && item .meta .title )
37
36
const first = matched[0 ]
38
- if (first && first .name .trim ().toLocaleLowerCase () !== ' Dashboard' .toLocaleLowerCase ()) {
37
+
38
+ if (! this .isDashboard (first)) {
39
39
matched = [{ path: ' /dashboard' , meta: { title: ' dashboard' }}].concat (matched)
40
40
}
41
41
42
42
this .levelList = matched .filter (item => item .meta && item .meta .title && item .meta .breadcrumb !== false )
43
43
},
44
+ isDashboard (route ) {
45
+ const name = route && route .name
46
+ if (! name) {
47
+ return false
48
+ }
49
+ return name .trim ().toLocaleLowerCase () === ' Dashboard' .toLocaleLowerCase ()
50
+ },
44
51
pathCompile (path ) {
45
52
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
46
53
const { params } = this .$route
You can’t perform that action at this time.
0 commit comments