Commit dead196b by liimin

menu css

1 parent 8f400269

1.22 KB | W: | H:

642 Bytes | W: | H:

src/assets/images/icons-v2/avatar.png
src/assets/images/icons-v2/avatar.png
src/assets/images/icons-v2/avatar.png
src/assets/images/icons-v2/avatar.png
  • 2-up
  • Swipe
  • Onion skin

308 Bytes | W: | H:

269 Bytes | W: | H:

src/assets/images/icons-v2/back.png
src/assets/images/icons-v2/back.png
src/assets/images/icons-v2/back.png
src/assets/images/icons-v2/back.png
  • 2-up
  • Swipe
  • Onion skin

551 Bytes | W: | H:

582 Bytes | W: | H:

src/assets/images/icons-v2/contact.png
src/assets/images/icons-v2/contact.png
src/assets/images/icons-v2/contact.png
src/assets/images/icons-v2/contact.png
  • 2-up
  • Swipe
  • Onion skin

444 Bytes | W: | H:

540 Bytes | W: | H:

src/assets/images/icons-v2/message.png
src/assets/images/icons-v2/message.png
src/assets/images/icons-v2/message.png
src/assets/images/icons-v2/message.png
  • 2-up
  • Swipe
  • Onion skin

53.4 KB | W: | H:

52.4 KB | W: | H:

src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -14,4 +14,12 @@
background-color: #EDECFF !important;
border-bottom: none;
}
@mixin menu-title-span-haspage{
font-size: 15px;
color: #333;
font-weight: 500;
}
@mixin menu-title-hover{
background-color: #f0f1f7 !important;
border-radius: 4px;
}
<template>
<div class="com-bc3">
<div class="back-wrap" v-show="breadcrumbs.isShowBack" @click="$router.back()">
<i class="i i-back"></i>
<span class="back-text">返回</span>
<div class="bt-back-wrap">
<i class="i i-back"></i>
<span class="back-text">返回</span>
</div>
<span class="sprator">|</span>
</div>
<div class="page-title">
<el-breadcrumb separator="/" v-if="auth.session">
<el-breadcrumb-item :to="{ path: ['', item.path][+isLink(item)] }" v-for="item in breadcrumbs.breads" :key="item.id" :class="{ isLink: isLink(item) }">{{ item.title }}</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: ['', item.path][+isLink(item)] }" v-for="item in breadcrumbs.breads" :key="item.id" :class="{ isLink: isLink(item) }">{{ item.title + item.path }}</el-breadcrumb-item>
</el-breadcrumb>
</div>
</div>
......@@ -27,7 +29,7 @@ export default {
breadcrumbs() {
const { currentPage, menuList: menus } = this.app
if (!currentPage || !menus?.length) return []
const { id: curId, title, navIds = curId.split('-'), curTitle = decodeURI(title), hidden } = currentPage
const { id: curId, title, navIds = curId.split('-'), curTitle = decodeURI(title) } = currentPage
const breads = navIds.reduce((navs, next) => {
const { length, nextId = length ? `${navs[length - 1].id}-${next}` : next } = navs
const [menu] = utils.array.valInDeep(menus, nextId, 'id', 'children')
......@@ -35,14 +37,14 @@ export default {
navs.push({ id, title: titleLogic, path })
return navs
}, [])
const isShowBack = curId?.split('-').length > 2 && hidden
return { breads, isShowBack }
// const isShowBack = curId?.split('-').length > 2 && hidden
return { breads, isShowBack: true }
},
...mapGetters(['app', 'auth'])
},
methods: {
isLink({ path }) {
return path.startsWith('/') && !path.includes('@')
return path.startsWith('/') && !path.startsWith('/^') && !path.includes('@')
}
}
}
......@@ -57,6 +59,8 @@ $bread-item-color: #333 !important;
font-size: 12px;
color: $bread-item-color;
cursor: pointer;
display: flex;
align-items: center;
i {
margin-right: 4px;
}
......@@ -64,6 +68,23 @@ $bread-item-color: #333 !important;
margin: 0 8px;
color: #c3c3c3;
}
.bt-back-wrap {
width: 52px;
height: 20px;
line-height: 20px;
background: #f2f2f2;
border-radius: 10px;
.back-text {
font-weight: 400;
color: #666;
}
&:hover {
background: #e8e8e8;
.back-text {
color: #333;
}
}
}
}
/deep/.el-breadcrumb {
&__item {
......
<template>
<div :class="['com-left-side-menu-lv1-item', isHighlight ? 'highlight' : '']" @mouseenter.stop="mouseenter" @mouseleave.stop="mouseleave" @click.stop="handleClick()">
<div :class="['com-left-side-menu-lv1-item', isActive]" @mouseenter.stop="mouseenter" @mouseleave.stop="mouseleave" @click.stop="handleClick()">
<i :class="['i', icon]"></i>
<span class="title">{{ menuData.title }}</span>
</div>
......@@ -25,7 +25,15 @@ export default {
return `i-${this.menuData.icon}${['', '-active'][+this.isHighlight]}`
},
isHighlight() {
return this.app?.currentPage?.id?.split('-')[0] == this.menuData.id || this.menu.hoverId == this.menuData.id
return this.app?.currentPage?.id?.split('-')[0] == this.menuData.id
},
isActive() {
if (this.isHighlight) {
return 'highlight'
} else if (this.menu.hoverId == this.menuData.id) {
return 'hover'
}
return ''
}
},
methods: {
......@@ -64,6 +72,9 @@ export default {
color: $main-color;
}
}
&.hover {
background-color: #f0f1f7;
}
.title {
font-size: 10px;
color: #666;
......
<template>
<div class="com-left-side-menu-lv2">
<GLScroll class="com-left-side-menu-lv2-scroll-y">
<el-menu class="flex-1 none-border" background-color="#fff" active-text-color="#409EFF" text-color="#999" :default-openeds="cur.openeds" :default-active="cur.active" :collapse-transition="false">
<el-menu class="flex-1 none-border" background-color="#fff" active-text-color="#409EFF" text-color="#999" :default-openeds="cur.openeds" :default-active="cur.active" :collapse-transition="false" ref="menus" @close="handleClose">
<LeftSideMenuLv2Item></LeftSideMenuLv2Item>
</el-menu>
</GLScroll>
......@@ -55,6 +55,9 @@ export default {
})
if (this.cur.openeds.toString() == _ids.toString()) return
this.cur.openeds = _ids
},
handleClose(key, keyPath) {
this.$refs.menus.open(keyPath)
}
}
}
......
......@@ -3,13 +3,13 @@
<div v-for="item in menus" :key="item.id">
<!-- 没有三级级菜单的二级菜单 -->
<div class="el-submenu" :class="{ active: `${current.lv1}-${current.lv2}` == item.id }" v-if="isMenuNoChildren(item)" @click.stop="handleModuleClick(item)">
<div class="el-submenu__title">
<div class="el-submenu__title hasNoChild">
<span>{{ item.title }}</span>
</div>
</div>
<!-- 有三级菜单的二级菜单 -->
<el-submenu v-else :index="item.id">
<span slot="title">{{ item.title }}</span>
<span slot="title" class="weaken">{{ item.title }}</span>
<!-- 渲染三级菜单 -->
<LeftSideMenuLv3 :menuItems="item.children"></LeftSideMenuLv3>
</el-submenu>
......@@ -77,7 +77,7 @@ export default {
this.bus.$emit('menuOpenedsChanged', { menus })
},
reload() {
if (this.menu.isCollapse || this.isPop ) return
if (this.menu.isCollapse || this.isPop) return
const { lv1 } = this.current
const [pid] = this.menus[0]?.id.split('-') || []
if (lv1 == pid) return
......@@ -108,31 +108,37 @@ $active-background-color: rgba(88, 80, 255, 0.2) !important;
line-height: 36px;
background-color: transparent !important;
padding: 0 8px !important;
&:hover {
// background-color: #fff !important;
span,
i {
color: $main-color !important;
}
}
span {
font-size: 15px;
color: #444;
font-weight: 600;
@include menu-title-span-haspage;
}
.el-submenu__icon-arrow {
right: 0;
// right: 0;
visibility: hidden;
}
}
&.is-active {
.el-submenu__title {
background-color: transparent !important;
span,
i {
color: $main-color !important;
&:not(.hasNoChild) {// has children title
cursor: default !important;
border-bottom: 1px solid #eee;
margin-bottom: 1px;
span {
font-size: 13px !important;
color: #999 !important;
font-weight: 400 !important;
cursor: default !important;
}
}
&.hasNoChild:hover {
@include menu-title-hover;
}
}
// &.is-active {
// .el-submenu__title {
// background-color: transparent !important;
// span,
// i {
// color: $main-color !important;
// }
// }
// }
&.active {
@include menu-highlight;
span {
......
......@@ -39,20 +39,19 @@ $menu-item-width: 144px !important;
display: flex;
flex-direction: column;
align-items: center;
gap: 1px;
.el-menu-item {
width: 100% !important;
min-width: 100% !important;
height: 32px;
line-height: 32px;
height: 36px;
line-height: 36px;
align-self: center;
border-radius: 4px;
// padding-left: 0 !important;
padding: 0 8px !important;
span {
color: #666;
font-size: 14px;
@include menu-title-span-haspage
}
&:hover,
&.is-active {
@include menu-highlight;
span {
......@@ -60,7 +59,7 @@ $menu-item-width: 144px !important;
}
}
&:hover:not(.is-active) {
background-color: transparent !important;
@include menu-title-hover;
}
}
}
......
......@@ -261,7 +261,7 @@ $tip-color: #666 !important;
margin: 0 4px;
}
&-avatar {
margin-left: 8px;
margin-left: 2px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
......
......@@ -143,7 +143,7 @@ function __gen(moduleName, menu) {
}
if (path.includes('^')) {
// const [originPath] = path.split('^')
_path = _gen_path_() + id
_path = '^'//_gen_path_() + id
redirect = _gen_path_(children.noHidden()[0].path)
} else {
_path = _gen_path_()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!