Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 6fc34d58
authored
Feb 08, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
382f2306
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
linkwe-pc/src/layout/components/TopNav/index.vue
linkwe-pc/src/layout/components/TopNav/index.vue
View file @
6fc34d5
...
...
@@ -55,15 +55,9 @@ export default {
},
// 默认激活的一级菜单路径 eg:/drainageCode
activeMenu
()
{
const
path
=
this
.
$route
.
path
let
activePath
=
this
.
routers
.
filter
((
e
)
=>
!
e
.
hidden
).
path
if
(
path
.
lastIndexOf
(
'/'
)
>
0
)
{
activePath
=
path
.
substring
(
0
,
path
.
indexOf
(
'/'
,
1
))
}
var
routes
=
this
.
activeRoutes
(
activePath
)
if
(
routes
.
length
===
0
)
{
activePath
=
path
}
let
activePath
=
this
.
$route
.
path
.
match
(
/
\/[^\/]
+/
)
activePath
=
activePath
&&
activePath
[
0
]
this
.
activeRoutes
(
activePath
)
return
activePath
},
},
...
...
@@ -115,9 +109,10 @@ export default {
}
}
},
// 当前激活的
路由
// 当前激活的
侧边栏菜单
activeRoutes
(
path
)
{
let
routes
=
this
.
routers
.
filter
((
e
)
=>
e
.
path
==
path
)
let
activeRoute
=
this
.
routers
.
find
((
e
)
=>
e
.
path
==
path
)
let
routes
=
(
activeRoute
&&
activeRoute
.
children
)
||
[]
if
(
routes
.
length
>
0
)
{
this
.
$store
.
commit
(
'SET_SIDEBAR_ROUTERS'
,
routes
)
}
...
...
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