index.jsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import React from 'react';
  2. import { Nav } from '@douyinfe/semi-ui';
  3. import { IconUser, IconStar, IconSetting, IconPlus, IconTriangleUp, IconTriangleDown } from '@douyinfe/semi-icons';
  4. export default function ArrowIcon() {
  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: 380 }}
  26. items={items}
  27. defaultOpenKeys={['job', 'star']}
  28. defaultSelectedKeys={['user']}
  29. expandIcon={<IconTriangleDown />}
  30. onSelect={data => console.log('trigger onSelect: ', data)}
  31. onClick={data => console.log('trigger onClick: ', data)}
  32. footer={{
  33. collapseButton: true,
  34. }}
  35. />
  36. <Nav
  37. bodyStyle={{ width: 520 }}
  38. items={items}
  39. mode='horizontal'
  40. defaultOpenKeys={['job', 'star']}
  41. defaultSelectedKeys={['user']}
  42. expandIcon={<IconTriangleDown />}
  43. footer={{
  44. collapseButton: true,
  45. }}
  46. />
  47. </div>
  48. );
  49. }