Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 24233e76
authored
Sep 22, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
youhua
1 parent
41cf52c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
src/layout/components/Breadcrumb3.vue
src/layout/components/Breadcrumb3.vue
View file @
24233e7
<
template
>
<div
class=
"com-bc3"
>
<div
class=
"back-wrap"
v-show=
"
page
.isShowBack"
@
click=
"$router.back()"
>
<div
class=
"back-wrap"
v-show=
"
breadcrumbs
.isShowBack"
@
click=
"$router.back()"
>
<i
class=
"i i-back"
></i>
<span
class=
"back-text"
>
返回
</span>
<span
class=
"sprator"
>
|
</span>
</div>
<div
class=
"page-title"
>
<el-breadcrumb
separator=
"/"
v-if=
"auth.session"
>
<el-breadcrumb-item
:to=
"
{ path: ['', item.path][+isLink(item)] }" v-for="item in breadcrumbs" :key="item.id" :class="isLink(item) ? 'isLink' : 'noLink'">
{{
item
.
title
}}
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{ path: ['', item.path][+isLink(item)] }" v-for="item in breadcrumbs
.breads
" :key="item.id" :class="isLink(item) ? 'isLink' : 'noLink'">
{{
item
.
title
}}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
</div>
...
...
@@ -24,27 +24,19 @@ export default {
[
BreadcrumbItem
.
name
]:
BreadcrumbItem
},
computed
:
{
page
()
{
const
{
id
,
hidden
,
title
:
pageTitle
=
''
}
=
this
.
app
.
currentPage
||
{}
const
isShowBack
=
id
?.
split
(
'-'
).
length
>
2
&&
hidden
const
title
=
decodeURI
(
pageTitle
)
return
{
isShowBack
,
title
}
},
breadcrumbs
()
{
const
{
currentPage
,
menuList
:
menus
}
=
this
.
app
if
(
!
currentPage
||
!
menus
||
!
menus
.
length
)
return
[]
const
{
id
:
curId
,
title
,
navIds
=
curId
.
split
(
'-'
),
curTitle
=
decodeURI
(
title
)
}
=
currentPage
return
navIds
.
reduce
((
navs
,
next
)
=>
{
if
(
!
currentPage
||
!
menus
?
.
length
)
return
[]
const
{
id
:
curId
,
title
,
navIds
=
curId
.
split
(
'-'
),
curTitle
=
decodeURI
(
title
)
,
hidden
}
=
currentPage
const
breads
=
navIds
.
reduce
((
navs
,
next
)
=>
{
const
{
length
,
nextId
=
length
?
`
${
navs
[
length
-
1
].
id
}
-
${
next
}
`
:
next
}
=
navs
const
[
menu
]
=
utils
.
array
.
valInDeep
(
this
.
app
.
menuList
,
nextId
,
'id'
,
'children'
)
||
[]
const
[
menu
]
=
utils
.
array
.
valInDeep
(
menus
,
nextId
,
'id'
,
'children'
)
const
{
id
,
title
,
path
,
titleLogic
=
nextId
===
curId
?
curTitle
:
title
}
=
menu
navs
.
push
({
id
,
title
:
titleLogic
,
path
})
return
navs
},
[])
},
isNotHome
()
{
const
{
currentPage
}
=
this
.
app
return
currentPage
&&
currentPage
.
path
!==
this
.
auth
.
session
.
defaultPath
const
isShowBack
=
curId
?.
split
(
'-'
).
length
>
2
&&
hidden
return
{
breads
,
isShowBack
}
},
...
mapGetters
([
'app'
,
'auth'
])
},
...
...
@@ -73,10 +65,6 @@ $bread-item-color: #333 !important;
color
:
#c3c3c3
;
}
}
.page-title
{
font-size
:
14px
;
color
:
$
bread-item-color
;
}
/
deep
/
.el-breadcrumb
{
&__item
{
.el-breadcrumb__inner
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment