From a34bc26ff137f4b4e81e2a406422f85f35e538f0 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 28 Jul 2017 15:52:22 +0800 Subject: [PATCH] =?UTF-8?q?menu=20=E6=94=AF=E6=8C=81=20icon=20=E5=B5=8C?= =?UTF-8?q?=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/iconfont/iconfont.js | 2 +- src/router/index.js | 7 ++++--- src/styles/sidebar.scss | 9 ++++----- src/views/layout/Layout.vue | 3 --- src/views/layout/SidebarItem.vue | 4 ++-- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/assets/iconfont/iconfont.js b/src/assets/iconfont/iconfont.js index 11a01bd9..8b1ffad9 100644 --- a/src/assets/iconfont/iconfont.js +++ b/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -(function(window){var svgSprite=""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+"";var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file +(function(window){var svgSprite=""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+"";var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 8daf20fa..d0a1a83e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -102,6 +102,7 @@ export const asyncRouterMap = [ component: _import('example/table/index'), redirect: '/example/table/table', name: 'Table', + icon: 'table', children: [ { path: 'dynamictable', component: _import('example/table/dynamictable'), name: '动态table' }, { path: 'dragtable', component: _import('example/table/dragTable'), name: '拖拽table' }, @@ -109,10 +110,10 @@ export const asyncRouterMap = [ { path: 'table', component: _import('example/table/table'), name: '综合table' } ] }, - { path: 'form/edit', component: _import('example/form'), name: '编辑Form', meta: { isEdit: true } }, - { path: 'form/create', component: _import('example/form'), name: '创建Form' }, + { path: 'form/edit', icon: 'ziliaoshouce', component: _import('example/form'), name: '编辑Form', meta: { isEdit: true } }, + { path: 'form/create', icon: 'yinhangqia', component: _import('example/form'), name: '创建Form' }, - { path: 'tab/index', component: _import('example/tab/index'), name: 'Tab' } + { path: 'tab/index', icon: 'mobankuangjia', component: _import('example/tab/index'), name: 'Tab' } ] }, { diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index 4775b476..44588586 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -7,17 +7,13 @@ margin-right: 16px; } -.hideSidebar .svg-icon { - margin-right: 0; -} - .hideSidebar .el-submenu>.el-submenu__title, .hideSidebar .submenu-title-noDropdown { padding-left: 10px!important; } .hideSidebar .submenu-title-noDropdown span, -.hideSidebar .el-submenu>.el-submenu__title span { +.hideSidebar .el-submenu>.el-submenu__title>span { height: 0; width: 0; overflow: hidden; @@ -32,6 +28,7 @@ height: auto; width: auto; visibility: visible; + display: inline; } .el-submenu__icon-arrow { display: block!important; @@ -65,6 +62,8 @@ visibility: visible; position: absolute; right: -145px; + text-align: left; + text-indent: 20px; top: 0px; background-color: #1f2d3d; opacity: 1; diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue index b30a4be7..7b39797e 100644 --- a/src/views/layout/Layout.vue +++ b/src/views/layout/Layout.vue @@ -51,9 +51,6 @@ left: 0; z-index: 1001; background: red; - // overflow-y: auto; - &::-webkit-scrollbar {display:none} - } .main-container { min-height: 100%; diff --git a/src/views/layout/SidebarItem.vue b/src/views/layout/SidebarItem.vue index 51778dca..a5810a9c 100644 --- a/src/views/layout/SidebarItem.vue +++ b/src/views/layout/SidebarItem.vue @@ -10,7 +10,7 @@