Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
c13b5747
Commit
c13b5747
authored
6 years ago
by
Pan
Browse files
Options
Downloads
Patches
Plain Diff
fix[Breadcurmb]: fixed pathCompile bug
parent
9df740bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Breadcrumb/index.vue
+7
-5
7 additions, 5 deletions
src/components/Breadcrumb/index.vue
with
7 additions
and
5 deletions
src/components/Breadcrumb/index.vue
+
7
−
5
View file @
c13b5747
...
...
@@ -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"
>
{{
generateTitle
(
item
.
meta
.
title
)
}}
</span>
<router-link
v-else
:to=
"item.redirect||item.path"
>
{{
generateTitle
(
item
.
meta
.
title
)
}}
</router-link>
<router-link
v-else
:to=
"item.redirect||
pathCompile(
item.path
)
"
>
{{
generateTitle
(
item
.
meta
.
title
)
}}
</router-link>
</el-breadcrumb-item>
</transition-group>
</el-breadcrumb>
...
...
@@ -30,12 +30,8 @@ export default {
methods
:
{
generateTitle
,
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
}
})
...
...
@@ -44,6 +40,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
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment