|
@@ -1,7 +1,7 @@
|
1
|
1
|
<template>
|
2
|
2
|
<el-breadcrumb class="app-breadcrumb" separator="/">
|
3
|
3
|
<transition-group name="breadcrumb">
|
4
|
|
- <el-breadcrumb-item v-for="(item,index) in levelList" v-if="item.meta.title&&item.meta.breadcrumb!==false" :key="item.path">
|
|
4
|
+ <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
5
|
5
|
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
|
6
|
6
|
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
7
|
7
|
</el-breadcrumb-item>
|
|
@@ -28,16 +28,14 @@ export default {
|
28
|
28
|
},
|
29
|
29
|
methods: {
|
30
|
30
|
getBreadcrumb() {
|
31
|
|
- let matched = this.$route.matched.filter(item => {
|
32
|
|
- if (item.name) {
|
33
|
|
- return true
|
34
|
|
- }
|
35
|
|
- })
|
|
31
|
+ let matched = this.$route.matched.filter(item => item.name)
|
|
32
|
+
|
36
|
33
|
const first = matched[0]
|
37
|
34
|
if (first && first.name !== 'dashboard') {
|
38
|
35
|
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
|
39
|
36
|
}
|
40
|
|
- this.levelList = matched
|
|
37
|
+
|
|
38
|
+ this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
41
|
39
|
},
|
42
|
40
|
pathCompile(path) {
|
43
|
41
|
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|