Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
web-monitor
Commits
2dcd0aa0
Commit
2dcd0aa0
authored
Nov 09, 2018
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix[Breadcurmb]: fixed pathCompile bug #217
parent
6df4a679
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
index.vue
src/components/Breadcrumb/index.vue
+7
-5
No files found.
src/components/Breadcrumb/index.vue
View file @
2dcd0aa0
...
...
@@ -3,7 +3,7 @@
<transition-group
name=
"breadcrumb"
>
<el-breadcrumb-item
v-for=
"(item,index) in levelList"
v-if=
"item.meta.title"
:key=
"item.path"
>
<span
v-if=
"item.redirect==='noredirect'||index==levelList.length-1"
class=
"no-redirect"
>
{{
item
.
meta
.
title
}}
</span>
<router-link
v-else
:to=
"item.redirect||
item.path
"
>
{{
item
.
meta
.
title
}}
</router-link>
<router-link
v-else
:to=
"item.redirect||
pathCompile(item.path)
"
>
{{
item
.
meta
.
title
}}
</router-link>
</el-breadcrumb-item>
</transition-group>
</el-breadcrumb>
...
...
@@ -28,12 +28,8 @@ export default {
},
methods
:
{
getBreadcrumb
()
{
const
{
params
}
=
this
.
$route
let
matched
=
this
.
$route
.
matched
.
filter
(
item
=>
{
if
(
item
.
name
)
{
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
var
toPath
=
pathToRegexp
.
compile
(
item
.
path
)
item
.
path
=
toPath
(
params
)
return
true
}
})
...
...
@@ -42,6 +38,12 @@ export default {
matched
=
[{
path
:
'/dashboard'
,
meta
:
{
title
:
'Dashboard'
}}].
concat
(
matched
)
}
this
.
levelList
=
matched
},
pathCompile
(
path
)
{
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
const
{
params
}
=
this
.
$route
var
toPath
=
pathToRegexp
.
compile
(
path
)
return
toPath
(
params
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment