Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input: add blur method #10356

Merged
merged 1 commit into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/docs/en-US/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ Search data from server-side.
| Method | Description | Parameters |
|------|--------|-------|
| focus | focus the input element | — |
| blur | blur the input element | — |
| select | select the text in input element | — |

### Autocomplete Attributes
Expand Down
1 change: 1 addition & 0 deletions examples/docs/es/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ Búsqueda de datos desde el servidor.
| Metodo | Descripción | Parametros |
| ------ | ----------------------------- | ---------- |
| focus | coloca el foco en el elemento | — |
| blur | blur the input element | — |
| select | select the text in input element | — |

### Autocomplete Atributos
Expand Down
1 change: 1 addition & 0 deletions examples/docs/zh-CN/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ export default {
| 方法名 | 说明 | 参数 |
| ---- | ---- | ---- |
| focus | 使 input 获取焦点 | — |
| blur | 使 input 失去焦点 | — |
| select | 选中 input 中的文字 | — |

### Autocomplete Attributes
Expand Down
3 changes: 3 additions & 0 deletions packages/input/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
focus() {
(this.$refs.input || this.$refs.textarea).focus();
},
blur() {
(this.$refs.input || this.$refs.textarea).blur();
},
getMigratingConfig() {
return {
props: {
Expand Down
5 changes: 5 additions & 0 deletions types/input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ export declare class ElInput extends ElementUIComponent {
*/
focus (): void

/**
* Blur the Input component
*/
blur (): void

/**
* Select the text in input element
*/
Expand Down