2017-11-06 19:22:02 +08:00
< style >
.demo-box.demo-progress {
.el-progress--line {
margin-bottom: 15px;
width: 350px;
}
.el-progress--circle {
margin-right: 15px;
}
}
< / style >
2017-11-12 05:06:29 +08:00
## Progreso
Progreso es usado para mostrar el estado de la operación actual e informar al usuario acerca de ésta.
2017-11-06 19:22:02 +08:00
2017-11-12 05:06:29 +08:00
### Barra de progreso lineal (porcentage externo)
2017-11-06 19:22:02 +08:00
2017-12-12 12:45:09 +08:00
:::demo Usa el atributo `percentage` para asignar el porcentage. Este es **requerido** y tiene que ser un valor entre `0-100` .
2017-11-06 19:22:02 +08:00
```html
< el-progress :percentage = "0" > < / el-progress >
< el-progress :percentage = "70" > < / el-progress >
2018-03-26 10:50:57 +08:00
< el-progress :percentage = "80" color = "#8e71c7" > < / el-progress >
2017-11-06 19:22:02 +08:00
< el-progress :percentage = "100" status = "success" > < / el-progress >
< el-progress :percentage = "50" status = "exception" > < / el-progress >
```
:::
2017-11-12 05:06:29 +08:00
### Barra de progreso lineal (porcentage interno)
En este caso el porcentage no toma espacio adicional.
2017-11-06 19:22:02 +08:00
2017-12-12 12:45:09 +08:00
:::demo El atributo `stroke-width` decide el ancho de la barra de progreso, y usa el atributo `text-inside` para poner la descripción dentro de la misma.
2017-11-06 19:22:02 +08:00
```html
< el-progress :text-inside = "true" :stroke-width = "18" :percentage = "0" > < / el-progress >
< el-progress :text-inside = "true" :stroke-width = "18" :percentage = "70" > < / el-progress >
2018-03-26 10:50:57 +08:00
< el-progress :text-inside = "true" :stroke-width = "18" :percentage = "80" color = "rgba(142, 113, 199, 0.7)" > < / el-progress >
2017-11-06 19:22:02 +08:00
< el-progress :text-inside = "true" :stroke-width = "18" :percentage = "100" status = "success" > < / el-progress >
< el-progress :text-inside = "true" :stroke-width = "18" :percentage = "50" status = "exception" > < / el-progress >
```
:::
2017-11-12 05:06:29 +08:00
### Barra de progreso circular
2017-11-06 19:22:02 +08:00
2017-12-12 12:45:09 +08:00
:::demo Puede asignar el atributo `type` como `circle` para usar la barra circular de progreso, y usar el atributo `width` para cambiar el tamaño del círculo.
2017-11-06 19:22:02 +08:00
```html
< el-progress type = "circle" :percentage = "0" > < / el-progress >
< el-progress type = "circle" :percentage = "25" > < / el-progress >
2018-03-26 10:50:57 +08:00
< el-progress type = "circle" :percentage = "80" color = "#8e71c7" > < / el-progress >
2017-11-06 19:22:02 +08:00
< el-progress type = "circle" :percentage = "100" status = "success" > < / el-progress >
< el-progress type = "circle" :percentage = "50" status = "exception" > < / el-progress >
2017-12-03 18:03:06 +08:00
```
2017-11-06 19:22:02 +08:00
:::
2017-12-03 18:03:06 +08:00
### Atributos
| Atributo | Descripción | Tipo | Valores aceptado | Por defecto |
| ------------ | ---------------------------------------- | ------- | ----------------- | ----------- |
| percentage | porcentaje, requerido | number | 0-100 | 0 |
| type | tipo de barra de progreso | string | line/circle | line |
| stroke-width | ancho de la barra de progreso | number | — | 6 |
| text-inside | mostrar el porcentaje dentro de la barra de progreso, solo funciona cuando `type` es 'line' | boolean | — | false |
| status | estado actual de la barra de progreso | string | success/exception | — |
2018-03-29 10:35:02 +08:00
| color | color de fondo de la barra de progreso. Sobreescribe la propiedad `status` | string | — | — |
2017-12-03 18:03:06 +08:00
| width | ancho del canvas que contiene la barra de progreso circula | number | — | 126 |
| show-text | mostrar porcentaje | boolean | — | true |