Skip to content

Commit

Permalink
fix: 修复侧边栏子菜单展开问题 (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
lianghx-319 authored Apr 1, 2020
1 parent e1447f2 commit 35554a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
26 changes: 13 additions & 13 deletions template/framework-admin/components/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,31 @@ export default {
flex-direction: column;
justify-content: space-between;
.el-menu {
> .el-menu {
box-sizing: border-box;
padding-top: 12px;
flex: 1;
border: none;
height: calc(100vh - @--footer-height - @--header-height);
width: 100% !important;
}
.el-menu-item {
&:hover {
color: @menu-active-text-color !important;
background-color: transparent !important;
}
&.is-active {
background-color: @--color-primary !important;
}
.el-menu-item {
&:hover {
color: @menu-active-text-color !important;
background-color: transparent !important;
}
[class*='icon'] {
font-size: 14px;
margin-right: 5px;
&.is-active {
background-color: @--color-primary !important;
}
}
[class*='icon'] {
font-size: 14px;
margin-right: 5px;
}
.fix-btn-wrap {
height: @--footer-height;
Expand Down
11 changes: 9 additions & 2 deletions template/framework-admin/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const cookieConfig = {
get domain() {
const {hostname} = location
// 本地环境
if (/^(127\.0\.0\.1|localhost)|(netlify\.com)$/.test(hostname))
if (!(/deepexi\.(com|top)$/.test(hostname)))
return hostname
// 线上环境
const s = hostname.indexOf('.')
Expand All @@ -17,12 +17,19 @@ const cookieConfig = {
},
}

const createMenuItem = ({name = '', id = '', pathUrl = '/', iconUrl}) => {
const createMenuItem = ({
name = '',
id = '',
pathUrl = '/',
iconUrl,
children = [],
}) => {
return {
url: pathUrl,
id: id,
name: name,
icon: iconUrl,
children: children?.length ? children.map(createMenuItem) : null,
}
}

Expand Down

0 comments on commit 35554a4

Please sign in to comment.