From 7e1ba16d12b03cc318b123ffc8fa2b0eec5d75bf Mon Sep 17 00:00:00 2001 From: Pan Date: Mon, 6 Nov 2017 16:02:13 +0800 Subject: [PATCH] refactor:add scroll-bar to sidebar --- src/components/ScrollBar/index.vue | 54 +++++++++++++++++++++++++ src/components/ScrollPane/index.vue | 1 - src/styles/sidebar.scss | 9 ++--- src/views/layout/components/Navbar.vue | 5 ++- src/views/layout/components/Sidebar.vue | 13 ++++-- 5 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 src/components/ScrollBar/index.vue diff --git a/src/components/ScrollBar/index.vue b/src/components/ScrollBar/index.vue new file mode 100644 index 00000000..8ef203be --- /dev/null +++ b/src/components/ScrollBar/index.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/components/ScrollPane/index.vue b/src/components/ScrollPane/index.vue index 667082a7..dc74400d 100644 --- a/src/components/ScrollPane/index.vue +++ b/src/components/ScrollPane/index.vue @@ -21,7 +21,6 @@ export default { const $containerWidth = $container.offsetWidth const $wrapper = this.$refs.scrollWrapper const $wrapperWidth = $wrapper.offsetWidth - console.log($containerWidth, $wrapperWidth) if (e.wheelDelta > 0) { this.left = Math.min(0, this.left + e.wheelDelta) } else { diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index eeb56142..1a854828 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -14,10 +14,6 @@ bottom: 0; left: 0; z-index: 1001; - overflow-y: auto; - &::-webkit-scrollbar { - display: none - } a { display: inline-block; width: 100%; @@ -27,12 +23,13 @@ } .el-menu { border: none; + width: 100%; } } .hideSidebar { - .sidebar-container { + .sidebar-container,.sidebar-container .el-menu { width: 36px!important; - overflow: inherit; + // overflow: inherit; } .main-container { margin-left: 36px; diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue index ee6d5c6a..33b3c18d 100644 --- a/src/views/layout/components/Navbar.vue +++ b/src/views/layout/components/Navbar.vue @@ -2,7 +2,7 @@ - +
@@ -111,6 +111,9 @@ export default { float: left; padding: 0 10px; } + .levelbar-container{ + float: left; + } .errLog-container { display: inline-block; vertical-align: top; diff --git a/src/views/layout/components/Sidebar.vue b/src/views/layout/components/Sidebar.vue index 301a86ee..a8028d0d 100644 --- a/src/views/layout/components/Sidebar.vue +++ b/src/views/layout/components/Sidebar.vue @@ -1,14 +1,19 @@