Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
project_progress
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 85285f7f
authored
Aug 12, 2024
by
liangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复首页点击一级菜单,已展开菜单不关闭问题。
1 parent
24328878
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
src/views/layout/leftBar.vue
src/views/layout/leftBar.vue
View file @
85285f7
...
...
@@ -3,14 +3,15 @@
<el-scrollbar
style=
"height: 900px"
ref=
"scroll"
>
<el-menu
router
ref=
"kzMenu"
class=
"el-menu-vertical-demo"
:unique-opened=
"true"
@
open=
"handleOpen"
@
close=
"handleClose"
:default-active=
"activeIndex"
ref=
"kzMenu"
>
<el-menu-item
index=
"/mainLayout/mianHome"
class=
"classmain"
><span
class=
""
></span>
首页
</el-menu-item>
<el-menu-item
index=
"/mainLayout/mianHome"
class=
"classmain"
@
click=
"allClose()"
><span
class=
""
></span>
首页
</el-menu-item>
<!--
<el-menu-item
index=
"/assesszc/projectView"
class=
"classmain"
><span></span>
项目知识文档库
</el-menu-item>
-->
<el-submenu
v-for=
"(item, index) in menuList"
...
...
@@ -59,6 +60,7 @@ export default {
openeds
:
[
"0"
],
//默认展开导航栏
activeIndex
:
""
,
routerTabs
:
[],
keyIndex
:
" "
};
},
props
:
{
...
...
@@ -94,11 +96,11 @@ export default {
if
(
!
this
.
routerTabs
.
includes
(
this
.
$route
.
meta
.
title
))
{
this
.
routerTabs
.
push
(
this
.
$route
.
meta
.
title
);
}
console
.
log
(
this
.
routerTabs
);
},
},
autho
(
newVal
,
oldVal
)
{
console
.
log
(
newVal
,
"newValnewVal"
);
if
(
newVal
==
"liyiming"
)
{
this
.
$router
.
push
({
path
:
"/mainLayout/confirmRelease"
,
...
...
@@ -138,8 +140,6 @@ export default {
this
.
$refs
.
kzMenu
.
activeIndex
=
this
.
$route
.
path
;
},
authority
(
newVal
,
oldVal
)
{
console
.
log
(
"oldVal:"
,
oldVal
);
// coderkey
console
.
log
(
"newVal:"
,
newVal
);
// pink
this
.
menuList
=
[];
if
(
newVal
==
1
)
{
this
.
menuList
=
trendsRules
(
1
);
...
...
@@ -186,6 +186,8 @@ export default {
methods
:
{
handleOpen
(
e
,
a
)
{
console
.
log
(
'打开'
,
e
)
this
.
keyIndex
=
e
.
charAt
(
0
)
this
.
$nextTick
(()
=>
{
this
.
$refs
.
scroll
.
update
();
});
...
...
@@ -200,21 +202,24 @@ export default {
}
else
if
(
a
.
length
==
2
)
{
let
opened
=
document
.
getElementsByClassName
(
"is-opened"
);
let
treeIcon2
=
opened
[
0
].
querySelectorAll
(
".treeIcon2"
);
console
.
log
(
treeIcon2
,
"333"
);
for
(
var
i
=
0
;
i
<
treeIcon2
.
length
;
i
++
)
{
treeIcon2
[
i
].
style
.
transform
=
"rotate(0deg)"
;
}
treeIcon2
[
e
.
slice
(
2
)].
style
.
transform
=
"rotate(90deg)"
;
}
},
allClose
(){
this
.
$refs
.
kzMenu
.
close
(
this
.
keyIndex
);
this
.
handleClose
(
this
.
keyIndex
,[
this
.
keyIndex
])
},
handleClose
(
e
,
a
)
{
console
.
log
(
"关闭"
,
e
);
console
.
log
(
"关闭"
,
e
,
a
);
if
(
a
.
length
==
1
)
{
let
treeIcon1
=
document
.
getElementsByClassName
(
"treeIcon1"
);
treeIcon1
[
e
].
style
.
transform
=
"rotate(0deg)"
;
let
treeIcon2
=
document
.
getElementsByClassName
(
"treeIcon2"
);
let
treARR
=
[...
treeIcon2
];
console
.
log
(
treARR
,
"treARRtreARR"
);
treARR
.
forEach
((
element
)
=>
{
element
.
style
.
transform
=
"rotate(0deg)"
;
});
...
...
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