index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import React from 'react';
  2. import { Nav } from '../../../index';
  3. import { IconUser, IconStar, IconUserGroup, IconEdit, IconApps, IconSetting } from '@douyinfe/semi-icons';
  4. const Demo = (props = {}) => {
  5. const superLargeSubs = [];
  6. const superLen = 120;
  7. for (let i = 0; i < superLen; i++) {
  8. superLargeSubs.push(`Item ${i}`);
  9. }
  10. return (
  11. <div style={{ width: '100%', height: '100vh' }}>
  12. <Nav
  13. defaultSelectedKeys={['人员管理']}
  14. style={{ height: '100%' }}
  15. bodyStyle={{ height: 480 }}
  16. items={[
  17. { itemKey: 'user', text: '用户管理', icon: <IconUser /> },
  18. { itemKey: 'union', text: '公会中心', icon: <IconStar /> },
  19. {
  20. itemKey: 'union-management',
  21. text: '公会管理',
  22. icon: <IconUserGroup />,
  23. items: ['公告设置', '公会查询', '信息录入'],
  24. },
  25. {
  26. itemKey: 'approve-management',
  27. text: '审批管理',
  28. icon: <IconEdit />,
  29. items: [
  30. '入驻审核',
  31. {
  32. itemKey: 'operation-management',
  33. text: '运营管理',
  34. items: ['人员管理', '人员变更'],
  35. },
  36. ],
  37. },
  38. {
  39. text: '超长导航列表',
  40. icon: <IconApps />,
  41. itemKey: 'long-list',
  42. maxHeight: 9999,
  43. items: superLargeSubs,
  44. },
  45. {
  46. text: '任务平台',
  47. icon: <IconSetting />,
  48. itemKey: 'job',
  49. items: ['任务管理', '用户任务查询'],
  50. },
  51. ]}
  52. onSelect={key => console.log(key)}
  53. header={{
  54. logo: <img src="https://sf6-cdn-tos.douyinstatic.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/webcast_logo.svg" />,
  55. text: 'Semi运营后台',
  56. }}
  57. footer={{
  58. collapseButton: true,
  59. collapseText: isCollapsed => <span>{isCollapsed ? '展开' : '收起'}</span>,
  60. }}
  61. />
  62. </div>
  63. );
  64. };
  65. export default Demo;