mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-30 13:23:49 +00:00
switchSIder
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Menu, Icon } from 'antd'
|
||||
import { Menu, Icon, Button } from 'antd'
|
||||
import { Link } from 'dva/router'
|
||||
import styles from './main.less'
|
||||
|
||||
const SubMenu = Menu.SubMenu
|
||||
|
||||
function Header({ location, user, logout }) {
|
||||
function handleClickMenu(item) {
|
||||
if (item.key === 'logout') {
|
||||
logout()
|
||||
}
|
||||
}
|
||||
let handleClickMenu = e => e.key === 'logout' && logout()
|
||||
let switchSider = () => {}
|
||||
return (
|
||||
<div className={styles.header}>
|
||||
<div className={styles.siderbutton} onClick={switchSider}>
|
||||
<Icon type="menu-fold" />
|
||||
</div>
|
||||
<Menu className="header-menu" mode="horizontal" onClick={handleClickMenu}>
|
||||
<SubMenu style={{ float: 'right' }}
|
||||
title={<span><Icon type="user" />{user.name}</span>}
|
||||
|
||||
@@ -43,6 +43,21 @@
|
||||
border: none;
|
||||
}
|
||||
box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
|
||||
position: relative;
|
||||
.siderbutton{
|
||||
height: 47px;
|
||||
width: 47px;
|
||||
line-height: 47px;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
transition: @transition-ease-in;
|
||||
&:hover{
|
||||
color: @primary-color;
|
||||
background-color: fade(@primary-color, 15%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bread {
|
||||
|
||||
Reference in New Issue
Block a user