custom-content.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <el-cascader :options="options">
  3. <template #default="{ node, data }">
  4. <span>{{ data.label }}</span>
  5. <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
  6. </template>
  7. </el-cascader>
  8. </template>
  9. <script lang="ts" setup>
  10. const options = [
  11. {
  12. value: 'guide',
  13. label: 'Guide',
  14. children: [
  15. {
  16. value: 'disciplines',
  17. label: 'Disciplines',
  18. children: [
  19. {
  20. value: 'consistency',
  21. label: 'Consistency',
  22. },
  23. {
  24. value: 'feedback',
  25. label: 'Feedback',
  26. },
  27. {
  28. value: 'efficiency',
  29. label: 'Efficiency',
  30. },
  31. {
  32. value: 'controllability',
  33. label: 'Controllability',
  34. },
  35. ],
  36. },
  37. {
  38. value: 'navigation',
  39. label: 'Navigation',
  40. children: [
  41. {
  42. value: 'side nav',
  43. label: 'Side Navigation',
  44. },
  45. {
  46. value: 'top nav',
  47. label: 'Top Navigation',
  48. },
  49. ],
  50. },
  51. ],
  52. },
  53. {
  54. value: 'component',
  55. label: 'Component',
  56. children: [
  57. {
  58. value: 'basic',
  59. label: 'Basic',
  60. children: [
  61. {
  62. value: 'layout',
  63. label: 'Layout',
  64. },
  65. {
  66. value: 'color',
  67. label: 'Color',
  68. },
  69. {
  70. value: 'typography',
  71. label: 'Typography',
  72. },
  73. {
  74. value: 'icon',
  75. label: 'Icon',
  76. },
  77. {
  78. value: 'button',
  79. label: 'Button',
  80. },
  81. ],
  82. },
  83. {
  84. value: 'form',
  85. label: 'Form',
  86. children: [
  87. {
  88. value: 'radio',
  89. label: 'Radio',
  90. },
  91. {
  92. value: 'checkbox',
  93. label: 'Checkbox',
  94. },
  95. {
  96. value: 'input',
  97. label: 'Input',
  98. },
  99. {
  100. value: 'input-number',
  101. label: 'InputNumber',
  102. },
  103. {
  104. value: 'select',
  105. label: 'Select',
  106. },
  107. {
  108. value: 'cascader',
  109. label: 'Cascader',
  110. },
  111. {
  112. value: 'switch',
  113. label: 'Switch',
  114. },
  115. {
  116. value: 'slider',
  117. label: 'Slider',
  118. },
  119. {
  120. value: 'time-picker',
  121. label: 'TimePicker',
  122. },
  123. {
  124. value: 'date-picker',
  125. label: 'DatePicker',
  126. },
  127. {
  128. value: 'datetime-picker',
  129. label: 'DateTimePicker',
  130. },
  131. {
  132. value: 'upload',
  133. label: 'Upload',
  134. },
  135. {
  136. value: 'rate',
  137. label: 'Rate',
  138. },
  139. {
  140. value: 'form',
  141. label: 'Form',
  142. },
  143. ],
  144. },
  145. {
  146. value: 'data',
  147. label: 'Data',
  148. children: [
  149. {
  150. value: 'table',
  151. label: 'Table',
  152. },
  153. {
  154. value: 'tag',
  155. label: 'Tag',
  156. },
  157. {
  158. value: 'progress',
  159. label: 'Progress',
  160. },
  161. {
  162. value: 'tree',
  163. label: 'Tree',
  164. },
  165. {
  166. value: 'pagination',
  167. label: 'Pagination',
  168. },
  169. {
  170. value: 'badge',
  171. label: 'Badge',
  172. },
  173. ],
  174. },
  175. {
  176. value: 'notice',
  177. label: 'Notice',
  178. children: [
  179. {
  180. value: 'alert',
  181. label: 'Alert',
  182. },
  183. {
  184. value: 'loading',
  185. label: 'Loading',
  186. },
  187. {
  188. value: 'message',
  189. label: 'Message',
  190. },
  191. {
  192. value: 'message-box',
  193. label: 'MessageBox',
  194. },
  195. {
  196. value: 'notification',
  197. label: 'Notification',
  198. },
  199. ],
  200. },
  201. {
  202. value: 'navigation',
  203. label: 'Navigation',
  204. children: [
  205. {
  206. value: 'menu',
  207. label: 'Menu',
  208. },
  209. {
  210. value: 'tabs',
  211. label: 'Tabs',
  212. },
  213. {
  214. value: 'breadcrumb',
  215. label: 'Breadcrumb',
  216. },
  217. {
  218. value: 'dropdown',
  219. label: 'Dropdown',
  220. },
  221. {
  222. value: 'steps',
  223. label: 'Steps',
  224. },
  225. ],
  226. },
  227. {
  228. value: 'others',
  229. label: 'Others',
  230. children: [
  231. {
  232. value: 'dialog',
  233. label: 'Dialog',
  234. },
  235. {
  236. value: 'tooltip',
  237. label: 'Tooltip',
  238. },
  239. {
  240. value: 'popover',
  241. label: 'Popover',
  242. },
  243. {
  244. value: 'card',
  245. label: 'Card',
  246. },
  247. {
  248. value: 'carousel',
  249. label: 'Carousel',
  250. },
  251. {
  252. value: 'collapse',
  253. label: 'Collapse',
  254. },
  255. ],
  256. },
  257. ],
  258. },
  259. {
  260. value: 'resource',
  261. label: 'Resource',
  262. children: [
  263. {
  264. value: 'axure',
  265. label: 'Axure Components',
  266. },
  267. {
  268. value: 'sketch',
  269. label: 'Sketch Templates',
  270. },
  271. {
  272. value: 'docs',
  273. label: 'Design Documentation',
  274. },
  275. ],
  276. },
  277. ]
  278. </script>