File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/components/Breadcrumb Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 3
3
<transition-group name =" breadcrumb" >
4
4
<el-breadcrumb-item v-for =" (item,index) in levelList" v-if =" item.meta.title" :key =" item.path" >
5
5
<span v-if =" item.redirect==='noredirect'||index==levelList.length-1" class =" no-redirect" >{{ generateTitle(item.meta.title) }}</span >
6
- <router-link v-else :to = " item.redirect||pathCompile (item.path )" >{{ generateTitle(item.meta.title) }}</router-link >
6
+ <a v-else @click.prevent = " handleLink (item)" >{{ generateTitle(item.meta.title) }}</a >
7
7
</el-breadcrumb-item >
8
8
</transition-group >
9
9
</el-breadcrumb >
@@ -46,6 +46,14 @@ export default {
46
46
const { params } = this .$route
47
47
var toPath = pathToRegexp .compile (path)
48
48
return toPath (params)
49
+ },
50
+ handleLink (item ) {
51
+ const { redirect , path } = item
52
+ if (redirect) {
53
+ this .$router .push (redirect)
54
+ return
55
+ }
56
+ this .$router .push (this .pathCompile (path))
49
57
}
50
58
}
51
59
}
You can’t perform that action at this time.
0 commit comments