Commit 3377cd08 authored by 杨奕's avatar 杨奕 Committed by GitHub

Input: add select method (#10229)

parent a294c628
......@@ -684,6 +684,13 @@ Search data from server-side.
| change | triggers when the icon inside Input value change | (value: string \| number) |
| clear | triggers when the Input is cleared by the button which generated by the "clearable" attribute | (event: Event) |
### Input Methods
| Method | Description | Parameters |
|------|--------|-------|
| focus | focus the input element | — |
| select | select the text in input element | — |
### Autocomplete Attributes
Attribute | Description | Type | Options | Default
......@@ -718,7 +725,8 @@ Attribute | Description | Type | Options | Default
|----| ----| ----|
|select | triggers when a suggestion is clicked | suggestion being clicked |
### Methods
### Autocomplete Methods
| Method | Description | Parameters |
|------|--------|-------|
| focus | focus the Input component | — |
| focus | focus the input element | — |
......@@ -663,6 +663,13 @@ Búsqueda de datos desde el servidor.
| change | se activa cuando cambia el valor de entrada | (value: string \| number) |
| clear | se dispara cuando la entrada es borrada por el botón generado por el atributo "clearable". | (event: Event) |
### Input Metodo
| Metodo | Descripción | Parametros |
| ------ | ----------------------------- | ---------- |
| focus | coloca el foco en el elemento | — |
| select | select the text in input element | — |
### Autocomplete Atributos
Atributo | Descripción | Tipo | Opciones | Por defecto
......@@ -695,7 +702,8 @@ Atributo | Descripción | Tipo | Opciones | Por defecto
| ------ | ---------------------------------------- | ---------------------------------------- |
| select | se dispara cuando se hace click a una sugerencia | sugerencia en la que se está haciendo click |
### Metodo
### Autocomplete Metodo
| Metodo | Descripción | Parametros |
| ------ | ----------------------------- | ---------- |
| focus | coloca el foco en el elemento | — |
......@@ -841,7 +841,8 @@ export default {
### Input Methods
| 方法名 | 说明 | 参数 |
| ---- | ---- | ---- |
| focus | 使 input 获取焦点 | - |
| focus | 使 input 获取焦点 | — |
| select | 选中 input 中的文字 | — |
### Autocomplete Attributes
......@@ -873,3 +874,8 @@ export default {
| 事件名称 | 说明 | 回调参数 |
|---------|--------|---------|
| select | 点击选中建议项时触发 | 选中建议项 |
### Autocomplete Methods
| 方法名 | 说明 | 参数 |
| ---- | ---- | ---- |
| focus | 使 input 获取焦点 | - |
......@@ -229,7 +229,7 @@
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
}
},
inputSelect() {
select() {
(this.$refs.input || this.$refs.textarea).select();
},
resizeTextarea() {
......@@ -291,7 +291,7 @@
},
created() {
this.$on('inputSelect', this.inputSelect);
this.$on('inputSelect', this.select);
},
mounted() {
......
......@@ -79,4 +79,9 @@ export declare class ElInput extends ElementUIComponent {
* Focus the Input component
*/
focus (): void
/**
* Select the text in input element
*/
select (): 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