Select: add blur method

pull/10430/head
Leopoldthecoder 2018-03-28 18:24:49 +08:00 committed by 杨奕
parent 7ae2662b7c
commit 46b70a5b89
5 changed files with 13 additions and 0 deletions

View File

@ -713,3 +713,4 @@ If the binding value of Select is an object, make sure to assign `value-key` as
| Method | Description | Parameters |
|------|--------|-------|
| focus | focus the Input component | - |
| blur | blur the Input component, and hide the dropdown | - |

View File

@ -719,3 +719,4 @@ Si el valor de encuadernación de Select es un objeto, asegúrese de asignar `va
| Metodo | Descripción | Parametros |
| ------ | --------------------------- | ---------- |
| focus | Foco en el componente input | - |
| blur | blur the Input component, and hide the dropdown | - |

View File

@ -708,3 +708,4 @@
| 方法名 | 说明 | 参数 |
| ---- | ---- | ---- |
| focus | 使 input 获取焦点 | - |
| blur | 使 input 失去焦点,并隐藏下拉框 | - |

View File

@ -537,6 +537,11 @@
}
},
blur() {
this.visible = false;
this.$refs.reference.blur();
},
handleBlur(event) {
this.$emit('blur', event);
},

5
types/select.d.ts vendored
View File

@ -73,4 +73,9 @@ export declare class ElSelect extends ElementUIComponent {
* Focus the Input component
*/
focus (): void
/**
* Blur the Input component, and hide the dropdown
*/
blur (): void
}