mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-03 11:47:48 +08:00
feat(components): [autocomplete] expose blur event (#8364)
* feat(components): [autocomplete] expose blur event * docs(components): [autocomplete] update
This commit is contained in:
parent
9c154e9228
commit
598f3ab5cd
@ -60,18 +60,13 @@ autocomplete/remote-search
|
||||
|
||||
## Autocomplete Slots
|
||||
|
||||
| Name | Description |
|
||||
| ------- | ------------------------------- |
|
||||
| prefix | content as Input prefix |
|
||||
| suffix | content as Input suffix |
|
||||
| prepend | content to prepend before Input |
|
||||
| append | content to append after Input |
|
||||
|
||||
## Autocomplete Scoped Slot
|
||||
|
||||
| Name | Description |
|
||||
| ---- | --------------------------------------------------------------------- |
|
||||
| — | Custom content for input suggestions. The scope parameter is { item } |
|
||||
| Name | Description |
|
||||
| ------- | --------------------------------------------------------------------- |
|
||||
| — | Custom content for input suggestions. The scope parameter is { item } |
|
||||
| prefix | content as Input prefix |
|
||||
| suffix | content as Input suffix |
|
||||
| prepend | content to prepend before Input |
|
||||
| append | content to append after Input |
|
||||
|
||||
## Autocomplete Events
|
||||
|
||||
@ -85,3 +80,4 @@ autocomplete/remote-search
|
||||
| Method | Description | Parameters |
|
||||
| ------ | ----------------------- | ---------- |
|
||||
| focus | focus the input element | — |
|
||||
| blur | blur the input element | — |
|
||||
|
@ -292,6 +292,10 @@ const focus = () => {
|
||||
inputRef.value?.focus()
|
||||
}
|
||||
|
||||
const blur = () => {
|
||||
inputRef.value?.blur()
|
||||
}
|
||||
|
||||
const handleSelect = async (item: any) => {
|
||||
emit(INPUT_EVENT, item[props.valueKey])
|
||||
emit(UPDATE_MODEL_EVENT, item[props.valueKey])
|
||||
@ -369,6 +373,8 @@ defineExpose({
|
||||
handleKeyEnter,
|
||||
/** @description focus the input element */
|
||||
focus,
|
||||
/** @description blur the input element */
|
||||
blur,
|
||||
/** @description close suggestion */
|
||||
close,
|
||||
/** @description highlight an item in a suggestion */
|
||||
|
Loading…
Reference in New Issue
Block a user