Commit 5d6fe5eb authored by 杨奕's avatar 杨奕 Committed by GitHub

Input: add blur method (#10356)

parent 0b330126
...@@ -689,6 +689,7 @@ Search data from server-side. ...@@ -689,6 +689,7 @@ Search data from server-side.
| Method | Description | Parameters | | Method | Description | Parameters |
|------|--------|-------| |------|--------|-------|
| focus | focus the input element | — | | focus | focus the input element | — |
| blur | blur the input element | — |
| select | select the text in input element | — | | select | select the text in input element | — |
### Autocomplete Attributes ### Autocomplete Attributes
......
...@@ -668,6 +668,7 @@ Búsqueda de datos desde el servidor. ...@@ -668,6 +668,7 @@ Búsqueda de datos desde el servidor.
| Metodo | Descripción | Parametros | | Metodo | Descripción | Parametros |
| ------ | ----------------------------- | ---------- | | ------ | ----------------------------- | ---------- |
| focus | coloca el foco en el elemento | — | | focus | coloca el foco en el elemento | — |
| blur | blur the input element | — |
| select | select the text in input element | — | | select | select the text in input element | — |
### Autocomplete Atributos ### Autocomplete Atributos
......
...@@ -842,6 +842,7 @@ export default { ...@@ -842,6 +842,7 @@ export default {
| 方法名 | 说明 | 参数 | | 方法名 | 说明 | 参数 |
| ---- | ---- | ---- | | ---- | ---- | ---- |
| focus | 使 input 获取焦点 | — | | focus | 使 input 获取焦点 | — |
| blur | 使 input 失去焦点 | — |
| select | 选中 input 中的文字 | — | | select | 选中 input 中的文字 | — |
### Autocomplete Attributes ### Autocomplete Attributes
......
...@@ -211,6 +211,9 @@ ...@@ -211,6 +211,9 @@
focus() { focus() {
(this.$refs.input || this.$refs.textarea).focus(); (this.$refs.input || this.$refs.textarea).focus();
}, },
blur() {
(this.$refs.input || this.$refs.textarea).blur();
},
getMigratingConfig() { getMigratingConfig() {
return { return {
props: { props: {
......
...@@ -80,6 +80,11 @@ export declare class ElInput extends ElementUIComponent { ...@@ -80,6 +80,11 @@ export declare class ElInput extends ElementUIComponent {
*/ */
focus (): void focus (): void
/**
* Blur the Input component
*/
blur (): void
/** /**
* Select the text in input element * Select the text in input element
*/ */
......
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