Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qr-consistency-vue3
Project
Project
Details
Activity
Releases
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
刘怀志
qr-consistency-vue3
Commits
d976c142
Commit
d976c142
authored
Apr 18, 2025
by
yanzhengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二级菜单、三级菜单选中样式bug修复
parent
26191ec6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
SidebarItem.vue
src/layout/components/Sidebar/SidebarItem.vue
+21
-0
No files found.
src/layout/components/Sidebar/SidebarItem.vue
View file @
d976c142
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
ref=
"subMenu"
ref=
"subMenu"
:index=
"resolvePath(item.path)"
:index=
"resolvePath(item.path)"
teleported
teleported
:default-active=
"activeMenu"
>
>
<
template
v-if=
"item.meta"
#
title
>
<
template
v-if=
"item.meta"
#
title
>
<svg-icon
:icon-class=
"item.meta && item.meta.icon"
/>
<svg-icon
:icon-class=
"item.meta && item.meta.icon"
/>
...
@@ -60,6 +61,7 @@
...
@@ -60,6 +61,7 @@
import
{
isExternal
}
from
'@/utils/validate'
import
{
isExternal
}
from
'@/utils/validate'
import
AppLink
from
'./Link'
import
AppLink
from
'./Link'
import
{
getNormalPath
}
from
'@/utils/ruoyi'
import
{
getNormalPath
}
from
'@/utils/ruoyi'
import
{
useRoute
}
from
"vue-router"
;
const
props
=
defineProps
({
const
props
=
defineProps
({
// route object
// route object
...
@@ -129,4 +131,23 @@ function hasTitle(title) {
...
@@ -129,4 +131,23 @@ function hasTitle(title) {
return
''
return
''
}
}
}
}
const
route
=
useRoute
()
const
activeMenu
=
computed
(()
=>
{
const
{
meta
,
path
}
=
route
if
(
meta
.
activeMenu
)
{
return
meta
.
activeMenu
}
return
path
})
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
.el-menu-item
{
color
:
v-bind
(
getMenuTextColor
);
&
.is-active
{
color
:
var
(
--
menu-active-text
,
#409eff
)
!
important
;
background-color
:
#f4f4f9
!
important
;
}
}
</
style
>
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