fix:menu vertical

This commit is contained in:
zuiidea
2017-01-13 22:42:54 +08:00
parent f41f4bcf29
commit 60ff1ec0bb
3 changed files with 3 additions and 16 deletions
+1 -13
View File
@@ -107,18 +107,6 @@
}
}
.siderMenu {
position: absolute;
width: 100%;
max-height: ~"calc(100% - 88px)";
overflow-y: scroll;
overflow-x: hidden;
&::-webkit-scrollbar-thumb {
display: none;
}
}
.switchtheme {
width: 100%;
position: absolute;
@@ -157,7 +145,7 @@
.ant-menu-item,
.ant-menu-submenu-title {
overflow: hidden;
overflow: auto;
white-space: normal;
}
}
+1 -2
View File
@@ -26,11 +26,10 @@ const getMenus = function (menuArray, siderFold, parentPath) {
})
}
function Menus ({ siderFold, darkTheme, location, isNavbar, handleClickNavMenu, className }) {
function Menus ({ siderFold, darkTheme, location, isNavbar, handleClickNavMenu }) {
const menuItems = getMenus(menu, siderFold)
return (
<Menu
className={className}
mode={siderFold ? 'vertical' : 'inline'}
theme={darkTheme ? 'dark' : 'light'}
onClick={handleClickNavMenu}
+1 -1
View File
@@ -16,7 +16,7 @@ function Sider ({ siderFold, darkTheme, location, changeTheme }) {
<img src={config.logoSrc} />
{siderFold ? '' : <span>{config.logoText}</span>}
</div>
<Menus {...menusProps} className={styles.siderMenu} />
<Menus {...menusProps} />
{!siderFold ? <div className={styles.switchtheme}>
<span><Icon type='bulb' />切换主题</span>
<Switch onChange={changeTheme} defaultChecked={darkTheme} checkedChildren='黑' unCheckedChildren='白' />