Commit 6180e59c authored by 陈帅's avatar 陈帅

handcode and use Automatically closed menu

parent b7ede088
......@@ -249,6 +249,9 @@ module.exports = [
},
],
},
{
component: '404',
},
],
},
];
......@@ -45,6 +45,7 @@ i.trigger {
.right {
float: right;
height: 100%;
width: 324px;
.action {
cursor: pointer;
padding: 0 12px;
......
......@@ -5,11 +5,31 @@ import BaseMenu from '../SiderMenu/BaseMenu';
import styles from './index.less';
export default class TopNavHeader extends PureComponent {
constructor(props) {
super(props);
this.state = {
maxWidth: (props.grid === 'Wide' ? 1200 : window.innerWidth) - 324 - 165 - 4,
};
}
static getDerivedStateFromProps(props) {
return {
maxWidth: (props.grid === 'Wide' ? 1200 : window.innerWidth) - 324 - 165 - 4,
};
}
render() {
const { theme, grid, logo } = this.props;
const { maxWidth } = this.state;
return (
<div className={`${styles.head} ${theme === 'light' ? styles.light : ''}`}>
<div className={`${styles.main} ${grid === 'Wide' ? styles.wide : ''}`}>
<div
ref={ref => {
this.maim = ref;
}}
className={`${styles.main} ${grid === 'Wide' ? styles.wide : ''}`}
>
<div className={styles.left}>
<div className={styles.logo} key="logo" id="logo">
<Link to="/">
......@@ -17,11 +37,16 @@ export default class TopNavHeader extends PureComponent {
<h1>Ant Design Pro</h1>
</Link>
</div>
<BaseMenu {...this.props} style={{ paddingTop: '9px', border: 'none' }} />
</div>
<div className={styles.right}>
<RightContent {...this.props} />
<div
style={{
flex: 1,
maxWidth,
}}
>
<BaseMenu {...this.props} style={{ border: 'none', height: 64 }} />
</div>
</div>
<RightContent {...this.props} />
</div>
</div>
);
......
......@@ -8,6 +8,7 @@
:global {
.ant-menu-submenu.ant-menu-submenu-horizontal {
height: 100%;
padding-top: 9px;
.ant-menu-submenu-title {
height: 100%;
}
......@@ -29,6 +30,9 @@
flex: 1;
display: flex;
}
.right {
width: 324px;
}
}
}
......
......@@ -3,5 +3,5 @@ import Link from 'umi/link';
import Exception from '@/components/Exception';
export default () => (
<Exception type="404" linkElement={Link} />
<Exception type="404" style={{ minHeight: 500, height: '100%' }} linkElement={Link} />
);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment