autocomplete.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { ElementUIComponent } from './component'
  2. import { IconClickEventHandler } from './input'
  3. export interface FetchSuggestionsCallback {
  4. /**
  5. * Callback function used in fetch-suggestions function
  6. *
  7. * @param data Suggestions to use
  8. */
  9. (data: any[]): void
  10. }
  11. export interface FetchSuggestions {
  12. /**
  13. * The function passed into the fetch-suggestions property
  14. *
  15. * @param queryString Current value of the text input
  16. * @param callback Callback function used to indicate that suggestions have completely fetched
  17. */
  18. (queryString: string, callback: FetchSuggestionsCallback): void
  19. }
  20. /** Autocomplete Component */
  21. export declare class ElAutocomplete extends ElementUIComponent {
  22. /** The placeholder of Autocomplete */
  23. placeholder: string
  24. /** Whether Autocomplete is disabled */
  25. disabled: boolean
  26. /** Icon name */
  27. icon: string
  28. /** Binding value */
  29. value: string
  30. /** Component name of your customized suggestion list item */
  31. customItem: string
  32. /** A method to fetch input suggestions. When suggestions are ready, invoke callback(data:[]) to return them to Autocomplete */
  33. fetchSuggestions: FetchSuggestions
  34. /** Custom class name for autocomplete's dropdown */
  35. popperClass: string
  36. /** Whether show suggestions when input focus */
  37. triggerOnFocus: boolean
  38. /** Hook function when clicking on the input icon */
  39. onIconClick: IconClickEventHandler
  40. }