If the options have a clear hierarchical structure, Cascader can be used to view and select them.
Si las opciones tienen una estructura jerárquica clara, Cascader puede utilizarse para visualizarlas y seleccionarlas.
### Basic usage
### Uso básico
There are two ways to expand child option items.
Existen dos maneras de expandir los elementos hijo de la opción.
:::demo Al asignar al atributo `options` un array de opciones, se genera un Cascader. El atributo `expand-trigger` define cómo se expanden las opciones hijo. Este ejemplo también muestra el evento `change` , cuyo parámetro es el valor de Cascader, un array formado por los valores de cada nivel seleccionado.
:::demo Assigning the `options` attribute to an array of options renders a Cascader. The `expand-trigger` attribute defines how child options are expanded. This example also demonstrates the `change` event, whose parameter is the value of Cascader, an array made up of the values of each selected level.
```html
```html
<divclass="block">
<divclass="block">
<spanclass="demonstration">Child options expand when clicked (default)</span>
<spanclass="demonstration">Child options expand when clicked (default)</span>
...
@@ -519,11 +520,12 @@ There are two ways to expand child option items.
...
@@ -519,11 +520,12 @@ There are two ways to expand child option items.
```
```
:::
:::
### Disabled option
### Opcion Disabled
Para desactivar una opción configure un campo `disabled` en el objeto de opción.
Disable an option by setting a `disabled` field in the option object.
:::demo En este ejemplo, el primer elemento del array `options` tiene un campo `disabled: true` , por lo que está desactivado. Por defecto, Cascader verifica el campo `disabled` en cada objeto de opción; si está utilizando otro nombre de campo para indicar si una opción está deshabilitada, puede asignarla en el atributo `props` (consulte la tabla API a continuación para obtener más detalles). Y por supuesto, el valor de `value`, `label` y `children` también se pueden personalizar de la misma manera.
:::demo In this example, the first item in `options` array has a `disabled: true` field, so it is disabled. By default, Cascader checks the `disabled` field in each option object; if you are using another field name to indicate whether an option is disabled, you can assign it in the `props` attribute (see the API table below for details). And of course, field name `value`, `label` and `children` can also be customized in the same way.
```html
```html
<el-cascader
<el-cascader
:options="optionsWithDisabled"
:options="optionsWithDisabled"
...
@@ -735,11 +737,12 @@ Disable an option by setting a `disabled` field in the option object.
...
@@ -735,11 +737,12 @@ Disable an option by setting a `disabled` field in the option object.
```
```
:::
:::
### Display only the last level
### Mostrar sólo el último nivel
The input can display only the last level instead of all levels.
Puede mostrar sólo el último nivel en lugar de todos los niveles.
:::demo El atributo `show-all-levels` define si se visualizan todos los niveles. Si es `false`, sólo se muestra el último nivel.
:::demo The `show-all-levels` attribute defines if all levels are displayed. If it is `false`, only the last level is displayed.
```html
```html
<el-cascader
<el-cascader
:options="options"
:options="options"
...
@@ -951,9 +954,9 @@ The input can display only the last level instead of all levels.
...
@@ -951,9 +954,9 @@ The input can display only the last level instead of all levels.
```
```
:::
:::
### With default value
### Con valor por defecto
:::demo The default value can be defined with an array.
:::demo El valor por defecto se puede definir con un array.
```html
```html
<el-cascader
<el-cascader
:options="options"
:options="options"
...
@@ -1168,9 +1171,10 @@ The input can display only the last level instead of all levels.
...
@@ -1168,9 +1171,10 @@ The input can display only the last level instead of all levels.
### Change on select
### Change on select
Parent options can also be selected.
También se pueden seleccionar las opciones del elemento padre.
:::demo Por defecto sólo se pueden seleccionar las opciones del último nivel. Al asignar `change-on-select` a `true`, también se pueden seleccionar opciones en los niveles superiores.
:::demo By default only the options in the last level can be selected. By assigning `change-on-select` to `true`, options in parent levels can also be selected.
```html
```html
<el-cascader
<el-cascader
:options="options"
:options="options"
...
@@ -1382,11 +1386,12 @@ Parent options can also be selected.
...
@@ -1382,11 +1386,12 @@ Parent options can also be selected.
```
```
:::
:::
### Dynamically load child options
### Carga dinamica de elementos hijos
Load child options when their parent option is clicked or hovered over.
Se puede hacer una carga dinamica de elementos hijos cuando se hace clic en el elemento padre o se pasa el ratón sobre el.
:::demo En este ejemplo, el array de opciones no tiene datos de ciudades cuando se inicializa. Con el evento `active-item-change`, puede cargar dinámicamente las ciudades de un estado específico. Además, este ejemplo también demuestra cómo se utilizan los`props`.
:::demo In this example, the options array does not have data of cities when initialized. With the `active-item-change` event, you can load the cities of a specific state dynamically. Besides, this example also demonstrates how `props` is used.
```html
```html
<el-cascader
<el-cascader
:options="options2"
:options="options2"
...
@@ -1433,11 +1438,12 @@ Load child options when their parent option is clicked or hovered over.
...
@@ -1433,11 +1438,12 @@ Load child options when their parent option is clicked or hovered over.
```
```
:::
:::
### Filterable
### Filtrable
Buscar y seleccionar opciones con una palabra clave.
Search and select options with a keyword.
:::demo Añadir `filterable` a `el-cascader` permite filtrar
:::demo Adding `filterable` to `el-cascader` enables filtering
```html
```html
<divclass="block">
<divclass="block">
<spanclass="demonstration">Only options of the last level can be selected</span>
<spanclass="demonstration">Only options of the last level can be selected</span>
...
@@ -1663,34 +1669,35 @@ Search and select options with a keyword.
...
@@ -1663,34 +1669,35 @@ Search and select options with a keyword.
```
```
:::
:::
### Attributes
### Atributos
| Attribute | Description | Type | Options | Default|
| Atributo | Descripción | Tipo | Opciones | Por defecto |
| disabled | si Cascader esta disabled | boolean | — | false |
| clearable | whether selected value can be cleared | boolean | — | false |
| clearable | si se puede borrar el valor seleccionado | boolean | — | false |
| expand-trigger | trigger mode of expanding current item | string | click / hover | click |
| expand-trigger | evento del elemento actual para expandirse. | string | click / hover | click |
| show-all-levels | whether to display all levels of the selected value in the input | boolean | — | true |
| show-all-levels | si mostrar todos los niveles del valor seleccionado en la entrada | boolean | — | true |
| filterable | whether the options can be searched | boolean | — | — |
| filterable | si se pueden buscar las opciones | boolean | — | — |
| debounce | debounce delay when typing filter keyword, in milliseconds | number | — | 300 |
| debounce | retardo al escribir la palabra clave del filtro, en milisegundos | number | — | 300 |
| change-on-select | whether selecting an option of any level is permitted | boolean | — | false |
| change-on-select | si se permite seleccionar una opción de cualquier nivel | boolean | — | false |
| size | size of Input | string | medium / small / mini | — |
| size | tamaño del input | string | medium / small / mini | — |
| before-filter | hook function before filtering with the value to be filtered as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, filtering will be aborted | function(value) | — | — |
| before-filter | funcion antes de filtrar con el valor a filtrar como parámetro. Si se devuelve `false` o se devuelve una `Promise` y luego es rechazada, el filtrado será abortado. | function(value) | — | — |
Toggleable menu for displaying lists of links and actions.
Menú conmutable para visualizar listas de enlaces y acciones.
### Basic usage
### Uso básico
Hover on the dropdown menu to unfold it for more actions.
Pase el ratón por el menú desplegable para desplegarlo y obtener más acciones.
:::demo The triggering element is rendered by the default `slot`, and the dropdown part is rendered by the `slot` named `dropdown`. By default, dropdown list shows when you hover on the triggering element without having to click it.
:::demo El elemento desencadenante se representa con el slot predeterminado, y la parte desplegable se representa con el slot llamado dropdown. Por defecto, la lista desplegable se muestra cuando se pasa el ratón por encima del elemento desencadenante sin necesidad de hacer clic en él.
```html
```html
<el-dropdown>
<el-dropdown>
...
@@ -86,11 +86,12 @@ Hover on the dropdown menu to unfold it for more actions.
...
@@ -86,11 +86,12 @@ Hover on the dropdown menu to unfold it for more actions.
:::
:::
### Triggering element
Elemento detonante
Use the button to trigger the dropdown list.
Utilizando un botón para activar la lista desplegable.
:::demo Utilice `split-button` para dividir el elemento detonante en un grupo de botones, siendo el botón izquierdo un botón normal y el botón derecho el objetivo real de la detonacion. Si desea insertar una línea de separación entre la posición tres y la posición cuatro, sólo añada un divisor de clase a la posición cuatro.
:::demo Use `split-button` to split the triggering element into a button group with the left button being a normal button and right one the actual triggering target. If you wanna insert a separator line between item three and item four, just add a class `divider` to item four.
```html
```html
<el-dropdown>
<el-dropdown>
<el-buttontype="primary">
<el-buttontype="primary">
...
@@ -139,11 +140,11 @@ Use the button to trigger the dropdown list.
...
@@ -139,11 +140,11 @@ Use the button to trigger the dropdown list.
```
```
:::
:::
### How to trigger
### Cómo detonar el evento
Click the triggering element or hover on it.
Haga clic en el elemento detonante o sobre él.
:::demo Use the attribute `trigger`. By default, it is `hover`.
:::demo Utilice el atributo `trigger`. Por defecto, es `hover`.
```html
```html
<el-rowclass="block-col-2">
<el-rowclass="block-col-2">
...
@@ -197,11 +198,12 @@ Click the triggering element or hover on it.
...
@@ -197,11 +198,12 @@ Click the triggering element or hover on it.
```
```
:::
:::
### Menu hiding behavior
### Ocultamiento del menú
Use `hide-on-click` para definir si el menú se cierra al hacer clic.
Use `hide-on-click` to define if menu closes on clicking.
:::demo El menú predeterminado se cerrará cuando haga clic en los elementos del menú, y se puede desactivar configurando `hide-on-click` como false.
:::demo By default menu will close when you click on menu items, and it can be turned off by setting hide-on-click to false.
```html
```html
<el-dropdown:hide-on-click="false">
<el-dropdown:hide-on-click="false">
<spanclass="el-dropdown-link">
<spanclass="el-dropdown-link">
...
@@ -228,9 +230,9 @@ Use `hide-on-click` to define if menu closes on clicking.
...
@@ -228,9 +230,9 @@ Use `hide-on-click` to define if menu closes on clicking.
```
```
:::
:::
### Command event
### Evento command
Clicking each dropdown item fires an event whose parameter is assigned by each item.
Al hacer clic en cada elemento desplegable se detona un evento cuyo parámetro es asignado por cada elemento.
:::demo
:::demo
```html
```html
...
@@ -269,11 +271,11 @@ Clicking each dropdown item fires an event whose parameter is assigned by each i
...
@@ -269,11 +271,11 @@ Clicking each dropdown item fires an event whose parameter is assigned by each i
```
```
:::
:::
### Sizes
### Tamaños
Besides default size, Dropdown component provides three additional sizes for you to choose among different scenarios.
Además del tamaño predeterminado, el componente Dropdown proporciona tres tamaños adicionales para que pueda elegir entre diferentes escenarios
:::demo Use attribute `size` to set additional sizes with `medium`, `small` or`mini`.
:::demo Utilice el atributo `size` para establecer tamaños adicionales con `medium`, `small` o`mini`.
```html
```html
<el-dropdownsplit-buttontype="primary">
<el-dropdownsplit-buttontype="primary">
...
@@ -319,28 +321,28 @@ Besides default size, Dropdown component provides three additional sizes for you
...
@@ -319,28 +321,28 @@ Besides default size, Dropdown component provides three additional sizes for you
@@ -325,17 +325,17 @@ It includes all kinds of input items, such as `input`, `select`, `radio` and `ch
...
@@ -325,17 +325,17 @@ It includes all kinds of input items, such as `input`, `select`, `radio` and `ch
:::
:::
:::tip
:::tip
[W3C](https://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2) regulates that
[W3C](https://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2) reglamenta que
> <i>When there is only one single-line text input field in a form, the user agent should accept Enter in that field as a request to submit the form.</i>
> <i>Cuando sólo hay un campo de entrada de texto de una sola línea en un formulario, el agente usuario debe aceptar <b>Enter</b> en ese campo como una solicitud para enviar el formulario.</i>
To prevent this behavior, you can add`@submit.native.prevent` on `<el-form>`.
Para prevenir este comportamiento, puede agregar`@submit.native.prevent` on `<el-form>`.
:::
:::
### Inline form
### Formulario inline
When the vertical space is limited and the form is relatively simple, you can put it in one line.
Cuando el espacio vertical es limitado y la forma es relativamente simple, puede ponerlo en una unica línea.
:::demo Set the `inline` attribute to `true` and the form will be inline.
:::demo Establezca el atributo `inline` como `true` y el formulario sera inline.
@@ -372,12 +372,14 @@ When the vertical space is limited and the form is relatively simple, you can pu
...
@@ -372,12 +372,14 @@ When the vertical space is limited and the form is relatively simple, you can pu
```
```
:::
:::
### Alignment
### Alineamiento
Depending on your design, there are several different ways to align your label element.
Dependiendo de su diseño, hay varias maneras diferentes de alinear el elemento de la etiqueta.
:::demo The `label-position` attribute decides how labels align, it can be `top` or `left`. When set to `top`, labels will be placed at the top of the form field.
:::demo The `label-position` attribute decides how labels align, it can be `top` or `left`. When set to `top`, labels will be placed at the top of the form field.
El atributo `label-position` decide cómo se alinean las etiquetas, puede estar `top` o `left`. Cuando se establece en `top`, las etiquetas se colocarán en la parte superior del campo de formulario.
@@ -413,11 +415,11 @@ Depending on your design, there are several different ways to align your label e
...
@@ -413,11 +415,11 @@ Depending on your design, there are several different ways to align your label e
```
```
:::
:::
### Validation
### Validación
Form component allows you to verify your data, helping you find and correct errors.
El componente `form` le permite verificar sus datos, ayudándole a encontrar y corregir errores.
:::demo Just add the `rules` attribute for `Form` component, pass validation rules, and set `prop` attribute for `Form-Item` as a specific key that needs to be validated. See more information at[async-validator](https://github.com/yiminghe/async-validator).
:::demo Sólo tiene que añadir el atributo `rules` en el componente `Form`, pasar las reglas de validación y establecer el atributo `prop` para `Form-Item` como una clave específica que necesita ser validada. Ver más información en[async-validator](https://github.com/yiminghe/async-validator).
@@ -626,9 +629,9 @@ This example shows how to customize your own validation rules to finish a two-fa
...
@@ -626,9 +629,9 @@ This example shows how to customize your own validation rules to finish a two-fa
```
```
:::
:::
### Delete or add form items dynamically
### Eliminar o agregar validaciones dinamicamente
:::demo In addition to passing all validation rules at once on the form component, you can also pass the validation rules or delete rules on a single form field dynamically.
:::demo Además de pasar todas las reglas de validación al mismo tiempo en el componente `form`, también puede pasar las reglas de validación o borrar reglas en un único campo de formulario de forma dinámica.
@@ -704,9 +707,10 @@ This example shows how to customize your own validation rules to finish a two-fa
...
@@ -704,9 +707,10 @@ This example shows how to customize your own validation rules to finish a two-fa
```
```
:::
:::
### Number Validate
### Validación numerica
::: demo La validacion numerica necesita un modificador `.number` añadido en el enlace `v-model` de entrada, sirve para transformar el valor de la cadena al número proporcionado por Vuejs.
::: demo Number Validate need a `.number` modifier added on the input `v-model` binding,it's used to transform the string value to the number which is provided by Vuejs.
@@ -754,14 +758,17 @@ This example shows how to customize your own validation rules to finish a two-fa
...
@@ -754,14 +758,17 @@ This example shows how to customize your own validation rules to finish a two-fa
:::
:::
:::tip
:::tip
When an `el-form-item` is nested in another `el-form-item`, its label width will be `0`. You can set `label-width` on that `el-form-item` if needed.
Cuando un `el-form-item` está anidado en otro `el-form-item`, su ancho de etiqueta será 0. Si es necesario, puede establecer el ancho de etiqueta en ese `el-form-item`.
:::
:::
### Size control
### Tamaño del control
Todos los componentes de un formulario heredan su atributo `size`. De manera similar, FormItem también tiene un atributo `size`.
All components in a Form inherit their `size` attribute from that Form. Similarly, FormItem also has a `size` attribute.
::: demo Aún así, puede ajustar el `size` de cada componente si no desea que herede su tamaño de From o FormItem.
::: demo Still you can fine tune each component's `size` if you don't want that component to inherit its size from From or FormIten.
| prop | a key of `model`. In the use of validate and resetFields method, the attribute is required | string | keys of model that passed to `form` |
| prop | un key de `model`. En el uso del método validate and resetFields, el atributo es obligatorio. | string | keys of model that passed to `form` | |
| label | label | string | — | — |
| label | etiqueta | string | — | — |
| label-width | width of label, e.g. '50px' | string | — | — |
| label-width | ancho de la etiqueta, e.g. '50px' | string | — | — |
| required | whether the field is required or not, will be determined by validation rules if omitted | string | — | false |
| required | si el campo es obligatorio o no, estará determinado por las reglas de validación si se omite. | string | — | false |
| rules | validation rules of form | object | — | — |
| rules | reglas de validacion del form | object | — | — |
| error | field error message, set its value and the field will validate error and show this message immediately | string | — | — |
| error | mensaje de error de campo, establezca su valor y el campo validará el error y mostrará este mensaje inmediatamente. | string | — | — |
| show-message | whether to show the error message | boolean | — | true |
| show-message | si mostrar o no el mensaje de error | boolean | — | true |
The default language of Element is Chinese. If you wish to use another language, you'll need to do some i18n configuration. In your entry file, if you are importing Element entirely:
El idioma predeterminado de Element es el chino. Si se desea utilizar otro idioma, será necesario realizar alguna configuración de i18n. En su fichero de entrada, si está importando Element por completo:
```javascript
```javascript
importVuefrom'vue'
importVuefrom'vue'
...
@@ -10,7 +10,7 @@ import locale from 'element-ui/lib/locale/lang/en'
...
@@ -10,7 +10,7 @@ import locale from 'element-ui/lib/locale/lang/en'
The Chinese language pack is imported by default, even if you're using another language. But with `NormalModuleReplacementPlugin` provided by webpack you can replace default locale:
El paquete de idioma chino se importa por defecto, incluso si se esta usando otro idioma. Pero con `NormalModuleReplacementPlugin` proporcionado por el webpack puede reemplazar la localización predeterminada:
webpack.config.js
webpack.config.js
```javascript
```javascript
...
@@ -37,9 +37,9 @@ webpack.config.js
...
@@ -37,9 +37,9 @@ webpack.config.js
}
}
```
```
## Compatible with `vue-i18n@5.x`
## Compatible con `vue-i18n@5.x`
Element is compatible with [vue-i18n@5.x](https://github.com/kazupon/vue-i18n), which makes multilingual switching even easier.
Element es compatible con [vue-i18n@5.x](https://github.com/kazupon/vue-i18n), lo que facilita aún más la conmutación multilingüe.
```javascript
```javascript
importVuefrom'vue'
importVuefrom'vue'
...
@@ -56,8 +56,8 @@ Vue.locale('zh-cn', zhLocale)
...
@@ -56,8 +56,8 @@ Vue.locale('zh-cn', zhLocale)
Vue.locale('en',enLocale)
Vue.locale('en',enLocale)
```
```
## Compatible with other i18n plugins
## Compatible con otros plugins i18n
Element may not be compatible with i18n plugins other than vue-i18n, but you can customize how Element processes i18n.
Es posible que Element no sea compatible con otros plugins i18n que no sean vue-i18n, pero puede personalizar la forma en que Element procesa i18n.
```javascript
```javascript
importVuefrom'vue'
importVuefrom'vue'
...
@@ -72,9 +72,9 @@ Vue.use(Element, {
...
@@ -72,9 +72,9 @@ Vue.use(Element, {
})
})
```
```
## Compatible with `vue-i18n@6.x`
## Compatible con `vue-i18n@6.x`
You need to manually handle it for compatibility with`6.x`.
Necesita manejarlo manualmente para ser compatible con`6.x`.
```javascript
```javascript
importVuefrom'vue'
importVuefrom'vue'
...
@@ -108,7 +108,7 @@ Vue.use(Element, {
...
@@ -108,7 +108,7 @@ Vue.use(Element, {
newVue({i18n}).$mount('#app')
newVue({i18n}).$mount('#app')
```
```
## Custom i18n in on-demand components
## Personalización de i18n en componentes bajo petición
Currently Element ships with the following languages:
Actualmente Element está disponible en los siguientes idiomas:
<ulclass="language-list">
<ulclass="language-list">
<li>Simplified Chinese (zh-CN)</li>
<li>Simplified Chinese (zh-CN)</li>
<li>English (en)</li>
<li>English (en)</li>
...
@@ -209,4 +209,4 @@ Currently Element ships with the following languages:
...
@@ -209,4 +209,4 @@ Currently Element ships with the following languages:
<li>Hebrew (he)</li>
<li>Hebrew (he)</li>
</ul>
</ul>
If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/master/src/locale/lang) and create a pull request.
Si su idioma de destino no está incluido, puede contribuir: simplemente añada [aqui](https://github.com/ElemeFE/element/tree/master/src/locale/lang) otra configuración de idioma y cree un pull request.
Input de valores numéricos con un rango personalizable.
### Basic usage
### Uso básico
:::demo Bind a variable to `v-model` in `<el-input-number>` element and you are set.
:::demo Vincule una variable con `v-model` en el elemento <el-input-number> y estará listo.
```html
```html
<template>
<template>
...
@@ -59,7 +59,7 @@ Input numerical values with a customizable range.
...
@@ -59,7 +59,7 @@ Input numerical values with a customizable range.
### Disabled
### Disabled
:::demo The `disabled` attribute accepts a `boolean`, and if the value is `true`, the component is disabled. If you just need to control the value within a range, you can add `min` attribute to set the minimum value and `max` to set the maximum value. By default, the minimum value is `0`.
:::demo El atributo `disabled` acepta un valor `boolean`, y si el valor es `true`, el componente queda deshabilitado. Si sólo necesita controlar el valor dentro de un rango, puede añadir un atributo `min` para establecer el valor mínimo y un valor `max` para establecer el valor máximo. Por defecto, el valor mínimo es `0`.
```html
```html
<template>
<template>
...
@@ -79,9 +79,9 @@ Input numerical values with a customizable range.
...
@@ -79,9 +79,9 @@ Input numerical values with a customizable range.
### Steps
### Steps
Allows you to define incremental steps.
Le permite definir el nivel de incremento de los saltos.
:::demo Add `step` attribute to set the step.
:::demo Añada el atributo `step` para establecer el salto.
```html
```html
<template>
<template>
...
@@ -99,9 +99,9 @@ Allows you to define incremental steps.
...
@@ -99,9 +99,9 @@ Allows you to define incremental steps.
```
```
:::
:::
### Size
### Tamaño
Use attribute `size` to set additional sizes with `medium`, `small` or`mini`.
Utilice el atributo `size` para establecer tamaños adicionales con `medium`, `small` o`mini`.
:::demo
:::demo
...
@@ -127,9 +127,10 @@ Use attribute `size` to set additional sizes with `medium`, `small` or `mini`.
...
@@ -127,9 +127,10 @@ Use attribute `size` to set additional sizes with `medium`, `small` or `mini`.
```
```
:::
:::
### Controls Position
### Posición de los controles
:::demo Establezca `controls-position` para decidir la posición de los botones de control.
:::demo Set `controls-position` to decide the position of control buttons.
var results = queryString ? links.filter(this.createStateFilter(queryString)) : links;
var results = queryString ? links.filter(this.createStateFilter(queryString)) : links;
cb(results);
cb(results);
},
},
querySearchAsync(queryString, cb) {
querySearchAsync(queryString, cb) {
var links = this.links;
var links = this.links;
var results = queryString ? links.filter(this.createStateFilter(queryString)) : links;
var results = queryString ? links.filter(this.createStateFilter(queryString)) : links;
clearTimeout(this.timeout);
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
this.timeout = setTimeout(() => {
cb(results);
cb(results);
...
@@ -106,17 +106,17 @@
...
@@ -106,17 +106,17 @@
}
}
.demo-autocomplete {
.demo-autocomplete {
text-align: center;
text-align: center;
.sub-title {
.sub-title {
margin-bottom: 10px;
margin-bottom: 10px;
font-size: 14px;
font-size: 14px;
color: #8492a6;
color: #8492a6;
}
}
.el-col:not(:last-child) {
.el-col:not(:last-child) {
border-right: 1px solid rgba(224,230,237,0.50);
border-right: 1px solid rgba(224,230,237,0.50);
}
}
.el-autocomplete {
.el-autocomplete {
text-align: left;
text-align: left;
}
}
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
li {
li {
line-height: normal;
line-height: normal;
padding: 7px *;
padding: 7px *;
.name {
.name {
text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
overflow: hidden;
...
@@ -144,9 +144,9 @@
...
@@ -144,9 +144,9 @@
## Input
## Input
Input data using mouse or keyboard.
Ingresa datos usando el ratón o teclado.
### Basic usage
### Uso básico
::: demo
::: demo
...
@@ -167,7 +167,7 @@ export default {
...
@@ -167,7 +167,7 @@ export default {
### Disabled
### Disabled
::: demo Disable the Input with the `disabled` attribute.
::: demo Deshabilite el Input con el atributo `disabled`.
```html
```html
<el-input
<el-input
...
@@ -188,11 +188,12 @@ export default {
...
@@ -188,11 +188,12 @@ export default {
```
```
:::
:::
### Input with icon
### Input con icono
Añada un icono para indicar el tipo de Input.
Add an icon to indicate input type.
::: demo Para añadir iconos en el Input, puede utilizar los atributos `prefix-icon` y `suffix-icon` . Además, los slots con nombre `prefix` y `suffix` también funcionan.
::: demo To add icons in Input, you can simply use `prefix-icon` and `suffix-icon` attributes. Also, the `prefix` and `suffix` named slots works as well.
Resizable for entering multiple lines of text information. Add attribute `type="textarea"` to change `input` into native`textarea`.
Redimensiona para introducir varias líneas de información de texto. Agrege el atributo `type="textarea"` para cambiar el `input` al tipo nativo`textarea`.
::: demo Control the height by setting the `rows` prop.
::: demo Controle la altura ajustando el prop `rows`.
```html
```html
<el-input
<el-input
...
@@ -269,9 +270,9 @@ export default {
...
@@ -269,9 +270,9 @@ export default {
```
```
:::
:::
### Autosize Textarea
### Textarea tamaño automatico
Setting the `autosize` prop for a textarea type of Input makes the height to automatically adjust based on the content. An options object can be provided to `autosize` to specify the minimum and maximum number of lines the textarea can automatically adjust.
El ajuste del prop `autosize` en el tipo de Input textarea hace que la altura se ajuste automáticamente en función del contenido. Se puede proporcionar opciones en un objeto para autodimensionar y especificar el número mínimo y máximo de líneas que el textarea puede ajustar automáticamente.
::: demo
::: demo
...
@@ -303,11 +304,11 @@ export default {
...
@@ -303,11 +304,11 @@ export default {
```
```
:::
:::
### Mixed input
### Mezclando elementos con input
Prepend or append an element, generally a label or a button.
Añade un elemento antes o después del input, generalmente una etiqueta o un botón.
::: demo Use `slot` to distribute elements that prepend or append to Input.
::: demo Utilice el `slot` para seleccionar si el elemento se colocara antes (prepend) o después (append) del Input.
```html
```html
<div>
<div>
...
@@ -354,9 +355,10 @@ export default {
...
@@ -354,9 +355,10 @@ export default {
```
```
:::
:::
### Sizes
### Tamaño
::: demo Añada el atributo `size` para cambiar el tamaño del Input. Además del tamaño predeterminado, hay otras tres opciones: `large`, `small` y `mini`.
::: demo Add `size` attribute to change the size of Input. In addition to the default size, there are three other options: `large`, `small` and `mini`.
```html
```html
<divclass="demo-input-size">
<divclass="demo-input-size">
<el-input
<el-input
...
@@ -395,11 +397,12 @@ export default {
...
@@ -395,11 +397,12 @@ export default {
```
```
:::
:::
### Autocomplete
### Autocompletado
You can get some recommended tips based on the current input.
Puede obtener algunas sugerencias basadas en la entrada actual.
::: demo El componente Autocomplete proporciona sugerencias de entrada. El atributo `fetch-suggestions` es un método que devuelve la entrada sugerida. En este ejemplo, `querySearch(queryString, cb)` devuelve las sugerencias al componente mediante `cb(data)` cuando están listas.
::: demo Autocomplete component provides input suggestions. The `fetch-suggestions` attribute is a method that returns suggested input. In this example, `querySearch(queryString, cb)` returns suggestions to Autocomplete via `cb(data)` when suggestions are ready.
```html
```html
<el-rowclass="demo-autocomplete">
<el-rowclass="demo-autocomplete">
<el-col:span="12">
<el-col:span="12">
...
@@ -468,11 +471,12 @@ You can get some recommended tips based on the current input.
...
@@ -468,11 +471,12 @@ You can get some recommended tips based on the current input.
```
```
:::
:::
### Custom template
### Template personalizado
Personalice cómo se muestran las sugerencias.
Customize how suggestions are displayed.
:::demo Utilice `scoped slot` para personalizar los elementos de sugerencias. En el scope, puede acceder al objeto de sugerencia mediante la clave `item`.
:::demo Use `scoped slot` to customize suggestion items. In the scope, you can access the suggestion object via the `item` key.
```html
```html
<el-autocomplete
<el-autocomplete
popper-class="my-autocomplete"
popper-class="my-autocomplete"
...
@@ -555,9 +559,9 @@ Customize how suggestions are displayed.
...
@@ -555,9 +559,9 @@ Customize how suggestions are displayed.
```
```
:::
:::
### Remote search
### Búsqueda remota
Search data from server-side.
Búsqueda de datos desde el servidor.
::: demo
::: demo
```html
```html
...
@@ -614,83 +618,83 @@ Search data from server-side.
...
@@ -614,83 +618,83 @@ Search data from server-side.
| suffix-icon | clase del icono de sufijo | string | — | — |
|rows | number of rows of textarea, only works when `type` is 'textarea' | number | — | 2 |
| rows | número de filas, sólo funciona cuando `type` es 'textarea'. | number | — | 2 |
|autosize | whether textarea has an adaptive height, only works when `type` is 'textarea'. Can accept an object, e.g. { minRows: 2, maxRows: 6 } | boolean / object | — | false |
| autosize | si textarea tiene una altura adaptativa, sólo funciona cuando el`type` es 'textarea'. Puede aceptar un objeto, p. ej. { minRows: 2, maxRows: 6 } | boolean / object | — | false |
|auto-complete | same as `auto-complete` in native input | string | on/off | off |
| auto-complete | igual que `auto-complete` en el input nativo | string | on/off | off |
|name | same as `name` in native input | string | — | — |
| name | igual que `name` en el input nativo | string | — | — |
| readonly | same as `readonly` in native input | boolean | — | false |
| readonly | igual que `readonly` en el input nativo | boolean | — | false |
|max | same as `max` in native input | — | — | — |
| max | igual que `max` en el input nativo | — | — | — |
|min | same as `min` in native input | — | — | — |
| min | igual que `min` en el input nativo | — | — | — |
|step| same as `step` in native input | — | — | — |
| step | igual que `step` en el input nativo | — | — | — |
|resize| control the resizability | string | none, both, horizontal, vertical | — |
| resize | control para el dimensionamiento | string | none, both, horizontal, vertical | — |
|autofocus | same as `autofocus` in native input | boolean | — | false |
| autofocus | igual que `autofocus` en el input nativo | boolean | — | false |
|form | same as `form` in native input | string | — | — |
| form | igual que `form` en el input nativo | string | — | — |
|disabled | si el Autocompete esta deshabilitado | boolean | — | false|
| valueKey | key name of the input suggestion object for display | string | — | value |
| valueKey | nombre del campo del objeto de sugerencia del input para la visualización | string | — | value |
|icon | icon name | string | — | — |
|icon | nombre del icono | string | — | — |
|value | binding value | string | — | — |
|value | valor enlazado | string | — | — |
| debounce | debounce delay when typing, in milliseconds | number | — | 300 |
| debounce | retardo al escribir, en milisegundos | number | — | 300 |
|fetch-suggestions | a method to fetch input suggestions. When suggestions are ready, invoke `callback(data:[])` to return them to Autocomplete | Function(queryString, callback) | — | — |
|fetch-suggestions | un método para obtener las sugerencias del input. Cuando las sugerencias estén listas, invocar `callback(data:[])` para devolverlas a Autocomplete | Function(queryString, callback) | — | — |
| popper-class | custom class name for autocomplete's dropdown | string | — | — |
| popper-class | nombre personalizado de clase para el dropdown de autocomplete | string | — | — |
| trigger-on-focus | whether show suggestions when input focus | boolean | — | true |
| trigger-on-focus | si se deben mostrar sugerencias cuando el input obtiene el foco | boolean | — | true |
| on-icon-click | hook function when clicking on the input icon | function | — | — |
| on-icon-click | funcion que se invoca cuando se hace click en el icono | function | — | — |
| name | same as `name` in native input | string | — | — |
| name | igual que `name` en el input nativo | string | — | — |
| select-when-unmatched | whether to emit a `select` event on enter when there is no autocomplete match | boolean | — | false |
| select-when-unmatched | si se emite un evento `select` al pulsar enter cuando no hay coincidencia de Autocomplete | boolean | — | false |
@@ -272,11 +273,12 @@ Disable the whole component.
...
@@ -272,11 +273,12 @@ Disable the whole component.
```
```
:::
:::
### Clearable single select
### Select simple limpiable
You can clear Select using a clear icon.
Puede limpiar un Select con un icono.
:::demo Establezca el atributo `clearable` para `el-select` y aparecerá un icono. Tenga en cuenta que la opción `clearable` es sólo para una selección individual.
:::demo Set `clearable` attribute for `el-select` and a clear icon will appear. Note that `clearable` is only for single select.
@@ -317,11 +319,12 @@ You can clear Select using a clear icon.
...
@@ -317,11 +319,12 @@ You can clear Select using a clear icon.
```
```
:::
:::
### Basic multiple select
### Selección múltiple básica
Selección multiple utiliza tags para mostrar las opciones seleccionadas.
Multiple select uses tags to display selected options.
:::demo Configure el atributo `multiple` para `el-select` para habilitar el modo múltiple. En este caso, el valor del `v-model` será un array de opciones seleccionadas. By default the selected options will be displayed as Tags. You can collapse them to a text by using `collapse-tags` attribute.
:::demo Set `multiple` attribute for `el-select` to enable multiple mode. In this case, the value of `v-model` will be an array of selected options. By default the selected options will be displayed as Tags. You can collapse them to a text by using `collapse-tags` attribute.
Puede personalizar templates HTML para las opciones.
:::demo Insert customized HTML templates into the slot of`el-option`.
:::demo Inserte templates HTML personalizados en el slot de`el-option`.
```html
```html
<template>
<template>
...
@@ -427,11 +430,11 @@ You can customize HTML templates for options.
...
@@ -427,11 +430,11 @@ You can customize HTML templates for options.
```
```
:::
:::
### Grouping
### Agrupando
Display options in groups.
Mostrar opciones en grupos.
:::demo Use `el-option-group` to group the options, and its `label` attribute stands for the name of the group.
:::demo Utilice `el-option-group` para agrupar las opciones, y su atributo `label` representa el nombre del grupo.
```html
```html
<template>
<template>
...
@@ -487,11 +490,12 @@ Display options in groups.
...
@@ -487,11 +490,12 @@ Display options in groups.
```
```
:::
:::
### Option filtering
### Filtrado de opciones
You can filter options for your desired ones.
Puede filtrar opciones como lo desee.
:::demo Añadir `filterable` a `el-select` permite filtrar. Por defecto, Select buscará todas las opciones cuyo atributo`label` contenga el valor del input. Si prefiere otras estrategias de filtrado, puede pasar el `filter-method`. `filter-method` es una función que se llama cuando el valor del input cambia, y su parámetro es el valor del input actual.
:::demo Adding `filterable` to `el-select` enables filtering. By default, Select will find all the options whose `label` attribute contains the input value. If you prefer other filtering strategies, you can pass the `filter-method`. `filter-method` is a `Function` that gets called when the input value changes, and its parameter is the current input value.
@@ -532,11 +536,11 @@ You can filter options for your desired ones.
...
@@ -532,11 +536,11 @@ You can filter options for your desired ones.
```
```
:::
:::
### Remote Search
### Búsqueda remota
Enter keywords and search data from server.
Introduzca palabras y datos para buscar desde el servidor.
:::demo Set the value of `filterable` and `remote` with `true` to enable remote search, and you should pass the `remote-method`. `remote-method` is a `Function` that gets called when the input value changes, and its parameter is the current input value. Note that if `el-option` is rendered with the `v-for` directive, you should add the `key` attribute for `el-option`. Its value needs to be unique, such as `item.value` in the following example.
:::demo Configure el valor de `filterable` y `remote` con `true` para habilitar la búsqueda remota, y debería pasar el método `remote-method`. `remote-method` es una función que se llama cuando el valor del input cambia, y su parámetro es el valor del input actual. Tenga en cuenta que si `el-option` se presenta con la directiva `v-for`, debe agregar el atributo `key` para `el-option`. Su valor tiene que ser unívoco, como el valor de `item.value` en el ejemplo siguiente.
```html
```html
<template>
<template>
...
@@ -611,9 +615,11 @@ Enter keywords and search data from server.
...
@@ -611,9 +615,11 @@ Enter keywords and search data from server.
```
```
:::
:::
### Create new items
### Crear nuevos items
Create and select new items that are not included in select options
Crear y seleccionar nuevos items que no están incluidas en las opciones de selección.
:::demo By using the `allow-create` attribute, users can create new items by typing in the input box. Note that for `allow-create` to work, `filterable` must be `true`.
:::demo Al utilizar el atributo `allow-create`, los usuarios pueden crear nuevos elementos escribiendo en el cuadro del input. Tenga en cuenta que para que `allow-create` funcione, `filterable` debe ser `true`.
```html
```html
<template>
<template>
<el-select
<el-select
...
@@ -654,58 +660,60 @@ Create and select new items that are not included in select options
...
@@ -654,58 +660,60 @@ Create and select new items that are not included in select options
:::
:::
:::tip
:::tip
If the binding value of Select is an object, make sure to assign `value-key` as its unique identity key name.
Si el valor de encuadernación de Select es un objeto, asegúrese de asignar `value-key` como el nombre único de la clave de identidad.
| multiple-limit | maximo numero de opciones que el usuario puede seleccionar cuando `multiple` es `true`. Sin límite cuando se fija a 0 | number | — | 0 |
| allow-create | whether creating new items is allowed. To use this, `filterable` must be true | boolean | — | false |
| name | el atributo `name` del input seleccionado | string | — | — |
| allow-create | si esta permitido crear nuevos items. Para usar esto, `filterable` debe ser `true`. | boolean | — | false |
| loading | whether Select is loading data from server | boolean | — | false |
| filter-method | metodo de filtrado personalizado | function | — | — |
| loading-text | displayed text while loading data from server | string | — | Loading |
| remote | si las opciones se traeran desde el servidor | boolean | — | false |
| no-match-text | displayed text when no data matches the filtering query | string | — | No matching data |
| remote-method | metodo de busqueda remota personalizada | function | — | — |
| no-data-text | displayed text when there is no options | string | — | No data |
| loading | si Select está cargando datos del servidor | boolean | — | false |
| popper-class | custom class name for Select's dropdown | string | — | — |
| loading-text | texto mostrado durante la carga de datos del servidor | string | — | Loading |
| reserve-keyword | when `multiple` and `filter` is true, whether to reserve current keyword after selecting an option | boolean | — | false |
| no-match-text | texto mostrado cuando ningún dato coincide con la consulta de filtrado. | string | — | No matching data |
| default-first-option | select first matching option on enter key. Use with `filterable` or `remote` | boolean | - | false |
| no-data-text | texto mostrado cuando no hay opciones | string | — | No data |
| popper-class | nombre de clase personalizado para el menú desplegable del Select | string | — | — |
### Select Events
| reserve-keyword | cuando `multiple` y `filter` es `true`, si se debe reservar la palabra clave actual después de seleccionar una opción. | boolean | — | false |
| Event Name | Description | Parameters |
| default-first-option | seleccione la primera opción de coincidencia en la tecla enter. Uso con `filterable` o `remote`. | boolean | - | false |
|---------|---------|---------|
| change | triggers when the selected value changes | current selected value |
### Select Eventos
| visible-change | triggers when the dropdown appears/disappears | true when it appears, and false otherwise |
| Nombre | Descripción | Parametros |
| remove-tag | triggers when a tag is removed in multiple mode | removed tag value |
| change | triggers when the value changes (if the mouse is being dragged, this event only fires when the mouse is released) | value after changing |
| change | se dispara cuando el valor cambia (si el ratón está comenzando el arrastre este evento sólo se disparara cuando se suelte el ratón) | valor despues del cambio |
Guide the user to complete tasks in accordance with the process. Its steps can be set according to the actual application scenario and the number of the steps can't be less than 2.
Guía al usuario para completar tareas de acuerdo con el proceso. Sus pasos pueden configurarse de acuerdo con el escenario de aplicación real y el número de pasos no puede ser inferior a dos.
### Basic usage
### Uso básico
Simple step bar.
Barra de pasos simple.
:::demo Set `active` attribute with `Number` type, which indicates the index of steps and starts from 0. You can set `space` attribute when the width of the step needs to be fixed which accepts `Boolean` type. The unit of the `space` attribute is `px`. If not set, it is responsive. Setting the `finish-status` attribute can change the state of the steps that have been completed.
:::demo Defina el atributo `active` con un valor de tipo `Number`, que indica el índice de pasos y comienza desde 0. Puede definir el atributo `space` cuando es necesario fijar el ancho del paso que acepta el tipo `Boolean`. La unidad del atributo `space` es px. Si no está configurado, es responsive. La configuración del atributo `finish-status` puede cambiar el estado de los pasos completados.
```html
```html
<el-steps:active="active"finish-status="success">
<el-steps:active="active"finish-status="success">
...
@@ -51,11 +51,11 @@ Simple step bar.
...
@@ -51,11 +51,11 @@ Simple step bar.
```
```
:::
:::
### Step bar that contains status
### Step bar con el status
Shows the status of the step for each step.
Muestra el estado del step para cada paso.
:::demo Use `title` attribute to set the name of the step, or override the attribute by using a named `slot`. We have listed all the slot names for you at the end of this page.
:::demo Utilice el atributo `title` para establecer el nombre del paso, o sobreescriba el atributo usando un slot con nombre. Hemos enumerado todos los nombres de slots al final de esta página.
@@ -66,9 +66,9 @@ Shows the status of the step for each step.
...
@@ -66,9 +66,9 @@ Shows the status of the step for each step.
```
```
:::
:::
### Center
### Centrado
Title and desription can be centered.
El título y la descripción pueden estar centrados.
:::demo
:::demo
```html
```html
...
@@ -81,9 +81,9 @@ Title and desription can be centered.
...
@@ -81,9 +81,9 @@ Title and desription can be centered.
```
```
:::
:::
### Step bar with description
### Step bar con descripción
There is description for each step.
Puede poner una descripción para cada paso.
:::demo
:::demo
```html
```html
...
@@ -97,9 +97,9 @@ There is description for each step.
...
@@ -97,9 +97,9 @@ There is description for each step.
### Step bar with icon
### Step bar with icon
A variety of custom icons can be used in the step bar.
En la barra de pasos se pueden utilizar diversos iconos personalizados.
:::demo The icon is set by the `icon` property. The types of icons can be found in the document for the Icon component. In addition, you can customize the icon through a named `slot`.
:::demo El icono se define mediante la propiedad `icon`. Los tipos de iconos se pueden encontrar en la descripción del componente Icono. Además, puede personalizar el icono a través de un slot con nombre.
```html
```html
<el-steps:active="1">
<el-steps:active="1">
...
@@ -110,11 +110,11 @@ A variety of custom icons can be used in the step bar.
...
@@ -110,11 +110,11 @@ A variety of custom icons can be used in the step bar.
```
```
:::
:::
### Vertical step bar
### Step bar vertical
Vertical step bars.
Step bar vertical.
:::demo You only need to set the `direction` attribute to` vertical` in the `el-steps` element.
:::demo Sólo tiene que fijar el atributo `direction` a ` vertical` en el elemento `el-steps`.
```html
```html
<divstyle="height: 300px;">
<divstyle="height: 300px;">
...
@@ -127,8 +127,8 @@ Vertical step bars.
...
@@ -127,8 +127,8 @@ Vertical step bars.
```
```
:::
:::
### Simple step bar
### Step bar simple
Simple step bars, where `align-center`, `description`, `direction` and `space` will be ignored.
Step bar simple, donde se ignorará `align-center`, `description`, `direction` y `space`.
:::demo
:::demo
```html
```html
...
@@ -147,30 +147,30 @@ Simple step bars, where `align-center`, `description`, `direction` and `space` w
...
@@ -147,30 +147,30 @@ Simple step bars, where `align-center`, `description`, `direction` and `space` w