This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
luffyZh
committed
Dec 9, 2020
1 parent
428f955
commit 663baf1
Showing
7 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react'; | ||
import { Layout, Menu } from 'antd'; | ||
import { | ||
MenuUnfoldOutlined, | ||
MenuFoldOutlined, | ||
UserOutlined, | ||
VideoCameraOutlined, | ||
UploadOutlined, | ||
} from '@ant-design/icons'; | ||
|
||
const { Header, Sider, Content } = Layout; | ||
|
||
class LayoutComp extends React.Component { | ||
state = { | ||
collapsed: false, | ||
}; | ||
|
||
toggle = () => { | ||
this.setState({ | ||
collapsed: !this.state.collapsed, | ||
}); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<Layout> | ||
<Sider trigger={null} collapsible collapsed={this.state.collapsed}> | ||
<div className="logo" /> | ||
<Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}> | ||
<Menu.Item key="1" icon={<UserOutlined />}> | ||
nav 1 | ||
</Menu.Item> | ||
<Menu.Item key="2" icon={<VideoCameraOutlined />}> | ||
nav 2 | ||
</Menu.Item> | ||
<Menu.Item key="3" icon={<UploadOutlined />}> | ||
nav 3 | ||
</Menu.Item> | ||
</Menu> | ||
</Sider> | ||
<Layout className="site-layout"> | ||
<Header className="site-layout-background" style={{ padding: 0 }}> | ||
{React.createElement(this.state.collapsed ? MenuUnfoldOutlined : MenuFoldOutlined, { | ||
className: 'trigger', | ||
onClick: this.toggle, | ||
})} | ||
</Header> | ||
<Content | ||
className="site-layout-background" | ||
style={{ | ||
margin: '24px 16px', | ||
padding: 24, | ||
minHeight: 280, | ||
}} | ||
> | ||
Content | ||
</Content> | ||
</Layout> | ||
</Layout> | ||
); | ||
} | ||
}; | ||
|
||
export default LayoutComp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.