Commit 46b70a5b authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

Select: add blur method

parent 7ae2662b
...@@ -713,3 +713,4 @@ If the binding value of Select is an object, make sure to assign `value-key` as ...@@ -713,3 +713,4 @@ If the binding value of Select is an object, make sure to assign `value-key` as
| Method | Description | Parameters | | Method | Description | Parameters |
|------|--------|-------| |------|--------|-------|
| focus | focus the Input component | - | | focus | focus the Input component | - |
| blur | blur the Input component, and hide the dropdown | - |
...@@ -719,3 +719,4 @@ Si el valor de encuadernación de Select es un objeto, asegúrese de asignar `va ...@@ -719,3 +719,4 @@ Si el valor de encuadernación de Select es un objeto, asegúrese de asignar `va
| Metodo | Descripción | Parametros | | Metodo | Descripción | Parametros |
| ------ | --------------------------- | ---------- | | ------ | --------------------------- | ---------- |
| focus | Foco en el componente input | - | | focus | Foco en el componente input | - |
| blur | blur the Input component, and hide the dropdown | - |
...@@ -708,3 +708,4 @@ ...@@ -708,3 +708,4 @@
| 方法名 | 说明 | 参数 | | 方法名 | 说明 | 参数 |
| ---- | ---- | ---- | | ---- | ---- | ---- |
| focus | 使 input 获取焦点 | - | | focus | 使 input 获取焦点 | - |
| blur | 使 input 失去焦点,并隐藏下拉框 | - |
...@@ -537,6 +537,11 @@ ...@@ -537,6 +537,11 @@
} }
}, },
blur() {
this.visible = false;
this.$refs.reference.blur();
},
handleBlur(event) { handleBlur(event) {
this.$emit('blur', event); this.$emit('blur', event);
}, },
......
...@@ -73,4 +73,9 @@ export declare class ElSelect extends ElementUIComponent { ...@@ -73,4 +73,9 @@ export declare class ElSelect extends ElementUIComponent {
* Focus the Input component * Focus the Input component
*/ */
focus (): void focus (): void
/**
* Blur the Input component, and hide the dropdown
*/
blur (): void
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment