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 1968b23a
authored
May 25, 2021
by
冒粤蓉
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix menu and remove reset.css
1 parent
d24185d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
164 additions
and
14 deletions
src/components/DesktopLeftSider/Sub/Menu.vue
src/main.js
src/components/DesktopLeftSider/Sub/Menu.vue
View file @
1968b23
<
template
>
<!-- 目前需求显示两级,代码可实现三级 -->
<div
class=
"menu"
>
<el-menu
<div
class=
"menu glsx-portal-menu"
>
<div
class=
"accordion"
>
<div
class=
"section"
v-for=
"(item, index) in menuList"
:key=
"item.origin.menuNo"
>
<input
type=
"radio"
name=
"accordion-radio"
:id=
"'section-'+index"
:checked=
"item.showSubList"
/>
<label
:for=
"'section-'+index"
>
<span>
{{
item
.
origin
.
menuName
}}
</span>
<!-- :class="
{'rotate-deg': item.showSubList}" -->
<i
class=
"el-icon-arrow-down"
v-if=
"item.children && item.children.length > 0"
></i>
</label>
<div
class=
"accordion-content"
v-if=
"item.children && item.children.length > 0"
>
<ul
class=
"accordion-ul"
>
<li
class=
"accordion-li"
:class=
"
{'is-actived':cItem.subItemActive}"
v-for="cItem in item.children"
:key="cItem.origin.menuNo"
@click.stop="cItemClick(cItem.origin.frontRoute || '', cItem, item)">
<span>
{{
cItem
.
origin
.
menuName
}}
</span>
</li>
</ul>
</div>
</div>
<!--
<div
class=
"section"
>
<input
type=
"radio"
name=
"accordion-1"
id=
"section-2"
value=
"toggle"
/>
<label
for=
"section-2"
><span>
Usage
</span></label>
<div
class=
"accordion-content"
>
<ul
class=
"accordion-ul"
>
<li><i
class=
"fa fa-cog"
></i><span>
System
</span></li>
<li><i
class=
"fa fa-group"
></i><span>
Users
</span></li>
<li><i
class=
"fa fa-sitemap"
></i><span>
Visitation
</span></li>
</ul>
</div>
</div>
-->
</div>
<!--
<el-menu
:uniqueOpened=
"true"
:default-active=
"defaultActive"
background-color=
"#001529"
text-color=
"hsla(0,0%,100%,.65)"
active-text-color=
"#fff"
>
...
...
@@ -28,7 +65,7 @@
</
template
>
</el-menu-item>
</div>
</el-menu>
</el-menu>
-->
<!-- 三级菜单 原生写法
<ul class="ant-menu ant-menu-inline ant-menu-sub"
v-for="thirdChildrenItem in cItem.children"
...
...
@@ -61,6 +98,11 @@ export default {
}
});
// 点击主菜单标题
const
titleClick
=
(
item
)
=>
{
item
.
showSubList
=
!
item
.
showSubList
;
};
// 高亮被选中的子集标题
const
setActive
=
(
arr
)
=>
{
arr
.
forEach
(
cEle
=>
{
...
...
@@ -323,6 +365,7 @@ export default {
return
{
...
toRefs
(
state
),
titleClick
,
cItemClick
,
subMenuClicked
,
updateMenu
,
...
...
@@ -340,13 +383,125 @@ export default {
<
style
lang=
"less"
scoped
>
@import
'styles/variables.less'
;
.menu
{
background-color
:
@
defaultThemeColor
;
}
.el-menu-item.is-active
{
background-color
:
@
defaultTextColor
!important
;
}
.glsx-portal-menu
{
background-color
:
@
defaultThemeColor
;
.accordion
{
color
:
hsla
(
0
,
0%
,
100%
,
.65
);
width
:
100%
;
font-size
:
14px
;
.section
{
width
:
100%
;
&:last-of-type
{
border-bottom
:
1px
solid
#363636
;
}
.accordion-content
{
padding
:
0
15px
;
max-height
:
0
;
-webkit-transition
:
all
0.4s
;
-moz-transition
:
all
0.4s
;
-ms-transition
:
all
0.4s
;
transition
:
all
0.4s
;
opacity
:
0
;
position
:
relative
;
overflow-y
:
hidden
;
}
input
[
type
=
'radio'
]
{
display
:
none
;
&:checked
+
label
{
//
background
:
#363636
;
color
:
#fff
;
}
&
:checked
+
label
:before
{
}
&
:checked
~
.accordion-content
{
padding
:
15px
0
;
max-height
:
300px
;
opacity
:
1
;
z-index
:
10
;
overflow-y
:
auto
;
}
}
label
{
position
:
relative
;
cursor
:
pointer
;
padding
:
15px
15px
15px
20px
;
display
:
table
;
width
:
100%
;
-webkit-transition
:
background
0.3s
ease-in-out
;
-moz-transition
:
background
0.3s
ease-in-out
;
-ms-transition
:
background
0.3s
ease-in-out
;
transition
:
background
0.3s
ease-in-out
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
-o-user-select
:
none
;
user-select
:
none
;
&:before
{
content
:
" "
;
width
:
100%
;
position
:
absolute
;
left
:
0
;
top
:
0
;
height
:
1px
;
}
&
:hover
{
color
:
#fff
;
//
background
:
@
defaultTextColor
;
}
span
{
display
:
table-cell
;
vertical-align
:
middle
;
}
}
.accordion-ul
{
width
:
100%
;
padding
:
0
;
margin
:
0
;
list-style
:
none
;
li
{
padding
:
12px
15px
12px
40px
;
&:hover
{
cursor
:
pointer
;
color
:
#fff
;
}
&
:hover
i
{
color
:
#fff
;
}
&
.is-actived
{
color
:
#fff
;
background-color
:
@
defaultTextColor
;
}
}
li
i
{
font-size
:
13px
;
width
:
15px
;
margin-right
:
15px
;
}
}
.el-icon-arrow-down
{
float
:
right
;
transition
:
transform
.3s
;
&.rotate-deg
{
transform
:
rotate
(
180deg
);
}
}
}
}
}
</
style
>
\ No newline at end of file
src/main.js
View file @
1968b23
...
...
@@ -7,17 +7,12 @@ import elementUI from '@/utils/globalUI/element'
import
microAppStart
from
"./micro/auth"
import
'element-plus/lib/theme-chalk/index.css'
;
import
'./assets/css/resets.css'
//
import './assets/css/resets.css'
microAppStart
();
const
app
=
createApp
(
App
);
app
.
config
.
warnHandler
=
function
(
msg
,
vm
,
trace
)
{
};
app
.
config
.
errorHandler
=
(
err
,
vm
,
info
)
=>
{
}
app
.
use
(
store
)
.
use
(
router
)
.
use
(
elementUI
)
...
...
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