index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React from 'react';
  2. import { Nav } from '@douyinfe/semi-ui';
  3. import { IconUser, IconStar, IconUserGroup, IconEdit, IconApps, IconSetting } from '@douyinfe/semi-icons';
  4. export default function DisabledNav() {
  5. const items = [
  6. { itemKey: 'user', text: '用户管理', icon: <IconUser />, disabled: true },
  7. { itemKey: 'union', text: '公会中心', icon: <IconStar /> },
  8. {
  9. text: '任务平台',
  10. icon: <IconSetting />,
  11. itemKey: 'job',
  12. disabled: true,
  13. items: [{ itemKey: 'job_manage', text: '任务管理', disabled: true }, '用户任务查询'],
  14. },
  15. {
  16. text: '收藏夹',
  17. icon: <IconStar />,
  18. itemKey: 'star',
  19. items: [{ itemKey: 'like', text: '我的喜欢', disabled: true }, '点赞'],
  20. },
  21. ];
  22. return (
  23. <div>
  24. <Nav
  25. bodyStyle={{ height: 520 }}
  26. items={items}
  27. defaultOpenKeys={['job', 'star']}
  28. defaultSelectedKeys={['user']}
  29. onSelect={data => console.log('trigger onSelect: ', data)}
  30. onClick={data => console.log('trigger onClick: ', data)}
  31. footer={{
  32. collapseButton: true,
  33. }}
  34. />
  35. <Nav
  36. mode="horizontal"
  37. bodyStyle={{ width: '100%' }}
  38. items={items}
  39. onSelect={data => console.log('trigger onSelect: ', data)}
  40. onClick={data => console.log('trigger onClick: ', data)}
  41. />
  42. </div>
  43. );
  44. }