cascader.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { VNode } from 'vue';
  2. import { ElementUIComponent, ElementUIComponentSize } from './component'
  3. import { CascaderOption, CascaderProps, CascaderNode } from './cascader-panel';
  4. export type CascaderOption = CascaderOption
  5. export type CascaderProps<V, D> = CascaderProps<V, D>
  6. export type CascaderNode<V, D> = CascaderNode<V, D>
  7. export interface CascaderSlots {
  8. /** Custom label content */
  9. default: VNode[],
  10. /** Empty content when no option matches */
  11. empty: VNode[]
  12. [key: string]: VNode[]
  13. }
  14. /** Cascader Component */
  15. export declare class ElCascader<V = any, D = CascaderOption> extends ElementUIComponent {
  16. /** Data of the options */
  17. options: CascaderOption[]
  18. /** Configuration options */
  19. props: CascaderProps<V, D>
  20. /** Selected value */
  21. value: V | V[]
  22. /** Size of Input */
  23. size: ElementUIComponentSize
  24. /** Input placeholder */
  25. placeholder: string
  26. /** Whether Cascader is disabled */
  27. disabled: boolean
  28. /** Whether selected value can be cleared */
  29. clearable: boolean
  30. /** Whether to display all levels of the selected value in the input */
  31. showAllLevels: boolean
  32. /** Whether to collapse selected tags in multiple selection mode */
  33. collapseTags: boolean
  34. /** Separator of option labels */
  35. separator: string
  36. /** Whether the options can be searched */
  37. filterable: boolean
  38. /** filter method to match options according to input keyword */
  39. filterMethod: (node: CascaderNode<V, D>, keyword: string) => boolean
  40. /** Debounce delay when typing filter keyword, in millisecond */
  41. debounce: number
  42. /** Custom class name for Cascader's dropdown */
  43. popperClass: string
  44. /** Hook function before filtering with the value to be filtered as its parameter */
  45. beforeFilter: (value: string) => boolean | Promise<any>
  46. $slots: CascaderSlots
  47. }