filterable.vue 8.3 KB

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