Commit cee29c9d by xinla

新版菜单调整基本完成

1 parent 295ed6b8
<style lang="scss" scoped>
.page {
padding: 16px 24px 24px;
}
</style>
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
......@@ -34,7 +29,7 @@ export default {
width: 100%;
position: relative;
overflow: auto;
background-color: #fff;
// background-color: #fff;
}
.fixed-header + .app-main {
......
<template>
<div style="padding: 0 15px;display: inline-block;" @click="toggleClick">
<div style="padding-right: 15px;display: inline-block;" @click="toggleClick">
<svg
:class="{ 'is-active': $store.state.app.sidebar.opened }"
class="hamburger"
......@@ -22,7 +22,7 @@ export default {
$route(route) {
// if you go to the redirect page, do not update the breadcrumbs
if (route.name == '首页') {
// this.$store.state.app.sidebar.opened = false
this.$store.state.app.sidebar.opened = 0
}
},
},
......
......@@ -197,6 +197,7 @@ export default {
margin: 0 20px;
flex: none;
position: relative;
cursor: pointer;
&.active::after {
content: '';
display: inline-block;
......
<template>
<router-view></router-view>
</template>
<script>
export default {}
</script>
<style></style>
......@@ -12,8 +12,14 @@
<div class="main main-size">
<sidebar v-if="$route.name !== '首页'" class="sidebar-container" />
<div class="main-container">
<hamburger id="hamburger-container" class="hamburger-container" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
<div v-show="$route.name !== '首页'">
<hamburger id="hamburger-container" class="hamburger-container" />
<span class="slogan">仟微科技 |</span>
<breadcrumb
id="breadcrumb-container"
class="breadcrumb-container"
/>
</div>
<!-- <div :class="{ 'fixed-header': fixedHeader }">
<navbar />
......@@ -99,6 +105,12 @@ export default {
.main-wrap {
height: calc(100vh - 58px);
background: #eee;
.main {
height: 100%;
padding: 10px;
display: flex;
align-items: stretch;
}
}
}
......@@ -138,4 +150,9 @@ export default {
background: rgba(0, 0, 0, 0.025);
}
}
.slogan {
font-size: 22px;
color: #999;
vertical-align: middle;
}
</style>
......@@ -38,6 +38,11 @@ export const constantRoutes = [
],
},
{
path: '',
redirect: '/index',
hidden: true,
},
{
path: '/index',
component: Layout,
redirect: '/index',
......
import { constantRoutes } from '@/router'
import { getRouters } from '@/api/menu'
import Layout from '@/layout/index'
import View from '@/layout/components/View'
const permission = {
state: {
......@@ -30,7 +31,7 @@ const permission = {
}
// 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap) {
function filterAsyncRouter(asyncRouterMap, level) {
return asyncRouterMap.filter((route) => {
if (route.component) {
// Layout组件特殊处理
......@@ -38,13 +39,17 @@ function filterAsyncRouter(asyncRouterMap) {
if (route.redirect === 'noRedirect' && route.children.length) {
route.redirect = route.path + '/' + route.children[0].path
}
route.component = Layout
if (level === 2) {
route.component = View
} else {
route.component = Layout
}
} else {
route.component = loadView(route.component)
}
}
if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children)
route.children = filterAsyncRouter(route.children, 2)
}
return true
})
......
#app {
.main-container {
min-height: 100%;
transition: margin-left 0.28s;
margin-left: $sideBarWidth;
transition: all 0.28s;
margin-left: 40px;
position: relative;
flex: auto;
overflow: hidden;
}
.sidebar-container {
transition: width 0.28s;
width: $sideBarWidth !important;
background-color: $menuBg;
height: calc(100% - 58px);
position: fixed;
font-size: 0px;
bottom: 0;
z-index: 1001;
overflow: hidden;
flex: none;
box-shadow: 0px 2px 2px 0px rgba(228, 228, 228, 0.35);
border-radius: 10px;
.el-menu-item.is-active {
color: #fff !important;
background-color: $menuActiveBg !important;
border-right: 2px solid #0079de;
}
// reset element-ui css
......@@ -91,11 +94,11 @@
.hideSidebar {
.sidebar-container {
width: 54px !important;
width: 0 !important;
}
.main-container {
margin-left: 54px;
margin-left: 0;
}
.submenu-title-noDropdown {
......
......@@ -15,12 +15,12 @@ $menuActiveText: #333;
$subMenuActiveText: #333; // https://github.com/ElemeFE/element/issues/12951
$menuBg: #fff;
$menuActiveBg: #4ca1e8;
$menuHover: #4ca1e8;
$menuActiveBg: #fafafa;
$menuHover: #fafafa;
$subMenuBg: #fff;
$subMenuActiveBg: #4ca1e8;
$subMenuHover: #4ca1e8;
$subMenuActiveBg: #fafafa;
$subMenuHover: #fafafa;
$sideBarWidth: 200px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!