Commit 6180e59c authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

handcode and use Automatically closed menu

parent b7ede088
...@@ -249,6 +249,9 @@ module.exports = [ ...@@ -249,6 +249,9 @@ module.exports = [
}, },
], ],
}, },
{
component: '404',
},
], ],
}, },
]; ];
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"dependencies": { "dependencies": {
"@antv/data-set": "^0.9.0", "@antv/data-set": "^0.9.0",
"@babel/runtime": "^7.0.0", "@babel/runtime": "^7.0.0",
"antd": "^3.9.0-beta.2", "antd": "3.9.0-beta.6",
"bizcharts": "^3.1.10", "bizcharts": "^3.1.10",
"bizcharts-plugin-slider": "^2.0.3", "bizcharts-plugin-slider": "^2.0.3",
"classnames": "^2.2.6", "classnames": "^2.2.6",
......
...@@ -45,6 +45,7 @@ i.trigger { ...@@ -45,6 +45,7 @@ i.trigger {
.right { .right {
float: right; float: right;
height: 100%; height: 100%;
width: 324px;
.action { .action {
cursor: pointer; cursor: pointer;
padding: 0 12px; padding: 0 12px;
......
...@@ -5,11 +5,31 @@ import BaseMenu from '../SiderMenu/BaseMenu'; ...@@ -5,11 +5,31 @@ import BaseMenu from '../SiderMenu/BaseMenu';
import styles from './index.less'; import styles from './index.less';
export default class TopNavHeader extends PureComponent { 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() { render() {
const { theme, grid, logo } = this.props; const { theme, grid, logo } = this.props;
const { maxWidth } = this.state;
return ( return (
<div className={`${styles.head} ${theme === 'light' ? styles.light : ''}`}> <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.left}>
<div className={styles.logo} key="logo" id="logo"> <div className={styles.logo} key="logo" id="logo">
<Link to="/"> <Link to="/">
...@@ -17,11 +37,16 @@ export default class TopNavHeader extends PureComponent { ...@@ -17,11 +37,16 @@ export default class TopNavHeader extends PureComponent {
<h1>Ant Design Pro</h1> <h1>Ant Design Pro</h1>
</Link> </Link>
</div> </div>
<BaseMenu {...this.props} style={{ paddingTop: '9px', border: 'none' }} /> <div
</div> style={{
<div className={styles.right}> flex: 1,
<RightContent {...this.props} /> maxWidth,
}}
>
<BaseMenu {...this.props} style={{ border: 'none', height: 64 }} />
</div>
</div> </div>
<RightContent {...this.props} />
</div> </div>
</div> </div>
); );
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
:global { :global {
.ant-menu-submenu.ant-menu-submenu-horizontal { .ant-menu-submenu.ant-menu-submenu-horizontal {
height: 100%; height: 100%;
padding-top: 9px;
.ant-menu-submenu-title { .ant-menu-submenu-title {
height: 100%; height: 100%;
} }
...@@ -29,6 +30,9 @@ ...@@ -29,6 +30,9 @@
flex: 1; flex: 1;
display: flex; display: flex;
} }
.right {
width: 324px;
}
} }
} }
......
...@@ -3,5 +3,5 @@ import Link from 'umi/link'; ...@@ -3,5 +3,5 @@ import Link from 'umi/link';
import Exception from '@/components/Exception'; import Exception from '@/components/Exception';
export default () => ( 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