index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <n-menu
  3. inverted
  4. :options="menuOptions"
  5. :value="$route.path"
  6. />
  7. </template>
  8. <script setup>
  9. import { h } from "vue";
  10. import { RouterLink } from "vue-router";
  11. import { NIcon } from "naive-ui";
  12. import { UnorderedListOutlined } from "@vicons/antd";
  13. function renderIcon(icon) {
  14. return () => h(NIcon, null, { default: () => h(icon) });
  15. }
  16. // 菜单的数据
  17. const menuOptions = [
  18. {
  19. label: () =>
  20. h(
  21. RouterLink,
  22. {
  23. to: "/project",
  24. },
  25. { default: () => "任务管理" }
  26. ),
  27. key: "/project",
  28. icon: renderIcon(UnorderedListOutlined),
  29. // children: [
  30. // {
  31. // label: () =>
  32. // h(
  33. // RouterLink,
  34. // {
  35. // to: "/equipment",
  36. // },
  37. // { default: () => "设备管理" }
  38. // ),
  39. // key: "/equipment",
  40. // },
  41. // {
  42. // label: () =>
  43. // h(
  44. // RouterLink,
  45. // {
  46. // to: "/data_source",
  47. // },
  48. // { default: () => "数据来源" }
  49. // ),
  50. // key: "/data_source",
  51. // },
  52. // {
  53. // label: () =>
  54. // h(
  55. // RouterLink,
  56. // {
  57. // to: "/data_edit",
  58. // },
  59. // { default: () => "数据编辑" }
  60. // ),
  61. // key: "/data_edit",
  62. // },
  63. // {
  64. // label: () =>
  65. // h(
  66. // RouterLink,
  67. // {
  68. // to: "/data_checkout",
  69. // },
  70. // { default: () => "数据校验" }
  71. // ),
  72. // key: "/data_checkout",
  73. // },
  74. // {
  75. // label: () =>
  76. // h(
  77. // RouterLink,
  78. // {
  79. // to: "/report_create",
  80. // },
  81. // { default: () => "报告生成" }
  82. // ),
  83. // key: "/report_create",
  84. // },
  85. // {
  86. // label: () =>
  87. // h(
  88. // RouterLink,
  89. // {
  90. // to: "/report_edit",
  91. // },
  92. // { default: () => "报告编辑" }
  93. // ),
  94. // key: "/report_edit",
  95. // },
  96. // {
  97. // label: () =>
  98. // h(
  99. // RouterLink,
  100. // {
  101. // to: "/report_audit",
  102. // },
  103. // { default: () => "报告审核" }
  104. // ),
  105. // key: "/report_audit",
  106. // },
  107. // ],
  108. },
  109. ];
  110. </script>
  111. <style scoped></style>