mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 23:00:20 +08:00
f3fa3f961b
* docs: improve Layout demo code * chore: fix css rule order
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { Breadcrumb, Layout, Menu, theme } from 'antd';
|
|
|
|
const { Header, Content, Footer } = Layout;
|
|
|
|
const App: React.FC = () => {
|
|
const {
|
|
token: { colorBgContainer },
|
|
} = theme.useToken();
|
|
|
|
return (
|
|
<Layout className="layout">
|
|
<Header style={{ display: 'flex', alignItems: 'center' }}>
|
|
<div className="demo-logo" />
|
|
<Menu
|
|
theme="dark"
|
|
mode="horizontal"
|
|
defaultSelectedKeys={['2']}
|
|
items={new Array(15).fill(null).map((_, index) => {
|
|
const key = index + 1;
|
|
return {
|
|
key,
|
|
label: `nav ${key}`,
|
|
};
|
|
})}
|
|
/>
|
|
</Header>
|
|
<Content style={{ padding: '0 50px' }}>
|
|
<Breadcrumb style={{ margin: '16px 0' }}>
|
|
<Breadcrumb.Item>Home</Breadcrumb.Item>
|
|
<Breadcrumb.Item>List</Breadcrumb.Item>
|
|
<Breadcrumb.Item>App</Breadcrumb.Item>
|
|
</Breadcrumb>
|
|
<div className="site-layout-content" style={{ background: colorBgContainer }}>
|
|
Content
|
|
</div>
|
|
</Content>
|
|
<Footer style={{ textAlign: 'center' }}>Ant Design ©2023 Created by Ant UED</Footer>
|
|
</Layout>
|
|
);
|
|
};
|
|
|
|
export default App;
|