Commit c8da1460 by 姜雷

修改菜单中图标组件

parent 6465e18a
...@@ -4,6 +4,7 @@ import Home from './containers/Home.vue'; ...@@ -4,6 +4,7 @@ import Home from './containers/Home.vue';
import DatePicker from './containers/DatePicker.vue'; import DatePicker from './containers/DatePicker.vue';
import SearchItem from './containers/SearchItem.vue'; import SearchItem from './containers/SearchItem.vue';
import Pagination from './containers/Pagination.vue'; import Pagination from './containers/Pagination.vue';
import layoutIcon from '../src/assets/images/menu/home.png';
Vue.use(Router); Vue.use(Router);
...@@ -25,7 +26,7 @@ export const routerMap = [ ...@@ -25,7 +26,7 @@ export const routerMap = [
{ {
path: '/layout', path: '/layout',
name: 'layout', name: 'layout',
meta: { title: '列表布局' }, meta: { title: '列表布局', icon: layoutIcon },
component: { render: h => <router-view /> }, component: { render: h => <router-view /> },
children: [ children: [
{ {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "rym-element-ui", "name": "rym-element-ui",
"version": "0.1.7", "version": "0.1.8",
"description": "任意门组件库", "description": "任意门组件库",
"main": "lib/rymUi.common.js", "main": "lib/rymUi.common.js",
"scripts": { "scripts": {
......
// media min-width // media min-width
$bigScreenWidth: 1600px; $bigScreenWidth: 1600px;
//sidebar //sidebar
$sideBar-width: 132px; $sideBar-width: 112px;
$menuBg: #477cfa; $menuBg: #477cfa;
$subMenuBg: #306bf6; $subMenuBg: #306bf6;
$menuHover: #1459fc; $menuHover: #1459fc;
......
<template> <template>
<div class="img-icon"> <div class="img-icon">
<img :src="`/static/menu/${iconName}.png`" /> <img :src="iconName" />
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'img-icon', name: "img-icon",
props: { props: {
iconName: { iconName: {
type: String, type: String
}, }
}, }
}; };
</script> </script>
...@@ -20,5 +20,10 @@ export default { ...@@ -20,5 +20,10 @@ export default {
width: 20px; width: 20px;
height: 20px; height: 20px;
overflow: hidden; overflow: hidden;
img {
display: block;
width: 100%;
height: 100%;
}
} }
</style> </style>
...@@ -11,9 +11,7 @@ ...@@ -11,9 +11,7 @@
</div> </div>
<div class="body-container"> <div class="body-container">
<div class="sidebar-container"> <slot name="nav"></slot>
<slot name="nav"></slot>
</div>
<div class="main-container"> <div class="main-container">
<slot></slot> <slot></slot>
</div> </div>
...@@ -83,13 +81,6 @@ body, ...@@ -83,13 +81,6 @@ body,
display: flex; display: flex;
height: calc(100vh - #{$topBar-height}); height: calc(100vh - #{$topBar-height});
} }
.sidebar-container {
transition: width 0.28s;
width: $sideBar-width;
height: 100%;
z-index: 1001;
overflow: hidden;
}
// 主体区域 // 主体区域
.main-container { .main-container {
flex: 1; flex: 1;
...@@ -99,10 +90,6 @@ body, ...@@ -99,10 +90,6 @@ body,
transition: margin-left 0.28s; transition: margin-left 0.28s;
background-color: #eee; background-color: #eee;
// main-container全局样式 // main-container全局样式
.app-main {
width: calc(100vw - #{$sideBar-width});
height: calc(100vh - #{$topBar-height} - 30px);
}
.main-wrap { .main-wrap {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -170,9 +157,6 @@ body, ...@@ -170,9 +157,6 @@ body,
.body-container { .body-container {
height: calc(100vh - #{$topBar-height}); height: calc(100vh - #{$topBar-height});
} }
.sidebar-container {
width: $sideBar-width;
}
.main-container { .main-container {
height: calc(100vh - #{$topBar-height}); height: calc(100vh - #{$topBar-height});
.main-wrap { .main-wrap {
......
<template> <template>
<scroll-bar class="navbar"> <div class="sidebar-container">
<el-menu <scroll-bar>
mode="vertical" <el-menu
:default-active="$route.path" mode="vertical"
unique-opened :default-active="$route.path"
background-color="transparent" unique-opened
text-color="#a9c2fb" background-color="transparent"
active-text-color="#fff" text-color="#a9c2fb"
ref="menu" active-text-color="#fff"
> ref="menu"
<sidebar-item :routes="routers"></sidebar-item> >
</el-menu> <sidebar-item :routes="routers"></sidebar-item>
</scroll-bar> </el-menu>
</scroll-bar>
</div>
</template> </template>
<script> <script>
...@@ -19,10 +21,12 @@ import Vue from "vue"; ...@@ -19,10 +21,12 @@ import Vue from "vue";
import SidebarItem from "./SidebarItem"; import SidebarItem from "./SidebarItem";
import ScrollBar from "@/components/ScrollBar"; import ScrollBar from "@/components/ScrollBar";
import { Menu, MenuItem, Submenu } from "element-ui"; import { Menu, MenuItem, Submenu } from "element-ui";
import ImgIcon from "../ImgIcon/ImgIcon";
// import { constantRouterMap } from "../../../../router/index.js"; // import { constantRouterMap } from "../../../../router/index.js";
Vue.component(Menu.name, Menu); Vue.component(Menu.name, Menu);
Vue.component(Submenu.name, Submenu); Vue.component(Submenu.name, Submenu);
Vue.component(MenuItem.name, MenuItem); Vue.component(MenuItem.name, MenuItem);
Vue.component(ImgIcon.name, ImgIcon);
export default { export default {
name: "sidebar-nav", name: "sidebar-nav",
...@@ -55,7 +59,7 @@ export default { ...@@ -55,7 +59,7 @@ export default {
<style lang="scss"> <style lang="scss">
@import "../../assets/styles/variables.scss"; @import "../../assets/styles/variables.scss";
.navbar { .sidebar-container {
transition: width 0.28s; transition: width 0.28s;
width: $sideBar-width; width: $sideBar-width;
height: 100%; height: 100%;
...@@ -113,7 +117,6 @@ export default { ...@@ -113,7 +117,6 @@ export default {
position: absolute; position: absolute;
right: -145px; right: -145px;
text-align: left; text-align: left;
text-indent: 20px;
top: 0px; top: 0px;
background-color: $subMenuBg !important; background-color: $subMenuBg !important;
opacity: 1; opacity: 1;
...@@ -149,6 +152,7 @@ export default { ...@@ -149,6 +152,7 @@ export default {
font-size: 12px; font-size: 12px;
} }
.el-menu-item { .el-menu-item {
text-align: left;
&:hover { &:hover {
background-color: $menuHover !important; background-color: $menuHover !important;
} }
...@@ -209,7 +213,6 @@ export default { ...@@ -209,7 +213,6 @@ export default {
} }
.el-menu-item { .el-menu-item {
text-align: left; text-align: left;
text-indent: 20px;
} }
&.is-opened { &.is-opened {
.el-submenu__title { .el-submenu__title {
...@@ -225,7 +228,7 @@ export default { ...@@ -225,7 +228,7 @@ export default {
@media screen and (min-width: $bigScreenWidth) { @media screen and (min-width: $bigScreenWidth) {
$sideBar-width: 132px; $sideBar-width: 132px;
.navbar { .sidebar-container {
width: $sideBar-width; width: $sideBar-width;
.img-icon { .img-icon {
width: 16px; width: 16px;
...@@ -250,11 +253,6 @@ export default { ...@@ -250,11 +253,6 @@ export default {
width: $sideBar-width; width: $sideBar-width;
min-width: $sideBar-width; min-width: $sideBar-width;
} }
.el-submenu {
.el-menu-item {
text-indent: 25px;
}
}
} }
} }
</style> </style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment