From 74bb623d681940dc5a928a8d30da77071fcf8706 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 18 Apr 2018 14:47:20 +0800 Subject: [PATCH] update element-ui --- package.json | 2 +- src/styles/sidebar.scss | 75 ++++++------------- .../layout/components/Sidebar/SidebarItem.vue | 9 ++- src/views/layout/components/Sidebar/index.vue | 11 ++- 4 files changed, 40 insertions(+), 57 deletions(-) diff --git a/package.json b/package.json index c8461ac..f75185c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "axios": "0.17.1", - "element-ui": "2.0.8", + "element-ui": "2.3.4", "js-cookie": "2.2.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index 2fed2b1..e8bc0ab 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -2,18 +2,21 @@ // 主体区域 .main-container { min-height: 100%; - transition: margin-left 0.28s; + transition: margin-left .28s; margin-left: 180px; - } // 侧边栏 + } + // 侧边栏 .sidebar-container { - transition: width 0.28s; - width: 180px!important; + transition: width .28s; + width: 180px !important; height: 100%; position: fixed; + font-size: 0px; top: 0; bottom: 0; left: 0; z-index: 1001; + overflow: hidden; a { display: inline-block; width: 100%; @@ -23,78 +26,48 @@ } .el-menu { border: none; - width: 100%; + width: 100% !important; } } .hideSidebar { - .sidebar-container,.sidebar-container .el-menu { - width: 36px!important; - // overflow: inherit; + .sidebar-container { + width: 36px !important; } .main-container { margin-left: 36px; } - } - .hideSidebar { .submenu-title-noDropdown { - padding-left: 10px!important; + padding-left: 10px !important; position: relative; - span { - height: 0; - width: 0; - overflow: hidden; - visibility: hidden; - transition: opacity .3s cubic-bezier(.55, 0, .1, 1); - opacity: 0; - display: inline-block; - } - &:hover { - span { - display: block; - border-radius: 3px; - z-index: 1002; - width: 140px; - height: 56px; - visibility: visible; - position: absolute; - right: -145px; - text-align: left; - text-indent: 20px; - top: 0px; - background-color: $subMenuBg!important; - opacity: 1; - } + .el-tooltip { + padding: 0 10px !important; } } .el-submenu { &>.el-submenu__title { - padding-left: 10px!important; + padding-left: 10px !important; &>span { - display: none; + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; } .el-submenu__icon-arrow { display: none; } } - .nest-menu { - .el-submenu__icon-arrow { - display: block!important; - } - span { - display: inline-block!important; - } - } } } .nest-menu .el-submenu>.el-submenu__title, .el-submenu .el-menu-item { - min-width: 180px!important; - background-color: $subMenuBg!important; + min-width: 180px !important; + background-color: $subMenuBg !important; &:hover { - background-color: $menuHover!important; + background-color: $menuHover !important; } } - .el-menu--collapse .el-menu .el-submenu{ - min-width: 180px!important; + .el-menu--collapse .el-menu .el-submenu { + min-width: 180px !important; } } diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue index 3555e73..4cd34ca 100644 --- a/src/views/layout/components/Sidebar/SidebarItem.vue +++ b/src/views/layout/components/Sidebar/SidebarItem.vue @@ -2,17 +2,18 @@