docs(components): [autocomplete] (#10478)

* Normalized API
This commit is contained in:
Xc 2022-11-06 22:34:50 +08:00 committed by GitHub
parent 1ec01130d8
commit 8a694e729b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ autocomplete/remote-search
:::
## Autocomplete APIs
## API
### Attributes
@ -50,7 +50,7 @@ autocomplete/remote-search
| model-value / v-model | binding value | ^[string] | — |
| debounce | debounce delay when typing, in milliseconds | ^[number] | 300 |
| placement | placement of the popup menu | ^[enum]`'top' \| 'top- start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end'` | bottom-start |
| fetch-suggestions | a method to fetch input suggestions. When suggestions are ready, invoke `callback(data:[])` to return them to Autocomplete | ^[Function]`(queryString: string, callback: callbackfn) => void` | — |
| fetch-suggestions | a method to fetch input suggestions. When suggestions are ready, invoke `callback(data:[])` to return them to Autocomplete | ^[Function]`(queryString: string, callback: callbackfn) => void` | — |
| popper-class | custom class name for autocomplete's dropdown | ^[string] | — |
| trigger-on-focus | whether show suggestions when input focus | ^[boolean] | true |
| name | same as `name` in native input | ^[string] | — |
@ -62,6 +62,13 @@ autocomplete/remote-search
| highlight-first-item | whether to highlight first item in remote search suggestions by default | ^[boolean] | false |
| fit-input-width | whether the width of the dropdown is the same as the input | ^[boolean] | false |
### Events
| Name | Description | Type |
| ------ | ------------------------------------------------ | ----------------------------------------------------- |
| select | triggers when a suggestion is clicked | ^[Function]`(item: typeof modelValue \| any) => void` |
| change | triggers when the icon inside Input value change | ^[Function]`(value: string \| number) => void` |
### Slots
| Name | Description |
@ -72,13 +79,6 @@ autocomplete/remote-search
| prepend | content to prepend before Input |
| append | content to append after Input |
### Events
| Name | Description | Type |
| ------ | ------------------------------------------------ | ----------------------------------------------------- |
| select | triggers when a suggestion is clicked | ^[Function]`(item: typeof modelValue \| any) => void` |
| change | triggers when the icon inside Input value change | ^[Function]`(value: string \| number) => void` |
### Instance Exposes
| Name | Description | Type |