Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
micro-portal
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
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 211b5562
authored
Mar 07, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
对子系统增加设置面包屑的方法
1 parent
2635e3a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
src/components/DesktopLeftSider/Sub/Menu.vue
src/utils/common/common.js
src/components/DesktopLeftSider/Sub/Menu.vue
View file @
211b556
...
@@ -155,6 +155,12 @@ export default {
...
@@ -155,6 +155,12 @@ export default {
// 点击二级菜单标题
// 点击二级菜单标题
const
cItemClick
=
(
path
,
cItem
,
parentItem
)
=>
{
const
cItemClick
=
(
path
,
cItem
,
parentItem
)
=>
{
console
.
log
(
'menuList:'
,
store
.
state
.
menu
.
menuList
)
console
.
log
(
'parentItem:'
,
parentItem
)
console
.
log
(
'path:'
,
path
)
console
.
log
(
'cItem:'
,
cItem
)
Common
.
setBreadCrumbs
(
path
);
const
cOrigin
=
cItem
.
origin
;
const
cOrigin
=
cItem
.
origin
;
const
pOrigin
=
parentItem
.
origin
;
const
pOrigin
=
parentItem
.
origin
;
let
showEmpty
=
false
;
let
showEmpty
=
false
;
...
...
src/utils/common/common.js
View file @
211b556
...
@@ -50,5 +50,34 @@ export const Common = {
...
@@ -50,5 +50,34 @@ export const Common = {
(
err
)
=>
{
}
(
err
)
=>
{
}
);
);
},
// 动态设置面包屑
setBreadCrumbs
(
url
)
{
let
list
=
store
.
state
.
menu
.
menuList
;
let
m
=
''
if
(
!
url
)
{
return
false
;
}
let
o
=
list
.
find
(
k
=>
{
let
n
=
(
k
.
children
||
[]).
find
(
j
=>
j
.
origin
.
frontRoute
==
url
);
if
(
n
)
{
m
=
n
;
return
k
}
})
let
arr
=
[]
// 一级菜单
if
(
o
)
{
arr
.
push
({
name
:
o
.
label
,
path
:
o
.
origin
.
frontRoute
})
}
// 二级菜单
if
(
m
)
{
arr
.
push
({
name
:
m
.
label
,
path
:
m
.
origin
.
frontRoute
})
}
}
store
.
dispatch
(
"menu/setBreadCrumb"
,
arr
);
}
}
}
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