mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-11-29 18:57:36 +08:00
Autocomplete: add change event (#17913)
This commit is contained in:
parent
73de4b655d
commit
3b7f95a308
@ -659,6 +659,7 @@ Attribute | Description | Type | Options | Default
|
||||
| Event Name | Description | Parameters |
|
||||
|----| ----| ----|
|
||||
|select | triggers when a suggestion is clicked | suggestion being clicked |
|
||||
| change | triggers when the icon inside Input value change | (value: string \| number) |
|
||||
|
||||
### Autocomplete Methods
|
||||
|
||||
|
@ -674,6 +674,7 @@ export default {
|
||||
| Nombre | Descripción | Parametros |
|
||||
| ------ | ----------------------------------------------- | ------------------------------------------ |
|
||||
| select | se dispara cuando se hace clic a una sugerencia | sugerencia en la que se está haciendo clic |
|
||||
| change | se activa cuando cambia el valor de entrada | (value: string \| number) |
|
||||
|
||||
### Autocomplete Metodo
|
||||
|
||||
|
@ -660,6 +660,7 @@ export default {
|
||||
| Nom | Description | Paramètres |
|
||||
|----| ----| ----|
|
||||
| select | Se déclenche quand une suggestion est cliquée. | La suggestion sélectionnée. |
|
||||
| change | Se déclenche quand la valeur change. | (value: string \ number) |
|
||||
|
||||
### Méthodes de l'autocomplétion
|
||||
|
||||
|
@ -769,6 +769,7 @@ export default {
|
||||
| 事件名称 | 说明 | 回调参数 |
|
||||
|---------|--------|---------|
|
||||
| select | 点击选中建议项时触发 | 选中建议项 |
|
||||
| change | 在 Input 值改变时触发 | (value: string \| number) |
|
||||
|
||||
### Autocomplete Methods
|
||||
| 方法名 | 说明 | 参数 |
|
||||
|
@ -10,7 +10,8 @@
|
||||
<el-input
|
||||
ref="input"
|
||||
v-bind="[$props, $attrs]"
|
||||
@input="handleChange"
|
||||
@input="handleInput"
|
||||
@change="handleChange"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
@clear="handleClear"
|
||||
@ -186,7 +187,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
handleChange(value) {
|
||||
handleInput(value) {
|
||||
this.$emit('input', value);
|
||||
this.suggestionDisabled = false;
|
||||
if (!this.triggerOnFocus && !value) {
|
||||
@ -196,6 +197,9 @@
|
||||
}
|
||||
this.debouncedGetData(value);
|
||||
},
|
||||
handleChange(event) {
|
||||
this.$emit('change', event.target.value);
|
||||
},
|
||||
handleFocus(event) {
|
||||
this.activated = true;
|
||||
this.$emit('focus', event);
|
||||
|
Loading…
Reference in New Issue
Block a user