index.tsx
919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React, { useState } from 'react';
import { ProfileOutlined, AppstoreOutlined, BarChartOutlined, ShopOutlined } from '@ant-design/icons';
import { Menu } from 'antd';
import { useNavigate, Outlet } from 'react-router-dom'
const items = [
{
label: '绩效排名',
key: 'ranking',
icon: <BarChartOutlined />,
},
{
label: '绩效明细',
key: 'detail',
icon: <ProfileOutlined />
},
{
label: '绩效分类',
key: 'classify',
icon: <AppstoreOutlined />
},
{
label: '我的',
key: 'mine',
icon: <ShopOutlined />
},
];
function Home() {
const [current, setCurrent] = useState('ranking');
const navigateTo = useNavigate()
const onClick = (e: any)=>{
navigateTo(e.key)
setCurrent(e.key);
}
return (<div>
<Menu onClick={onClick} selectedKeys={[current]} mode="horizontal" items={items} />
<Outlet />
</div>)
}
export default Home