:::demo Rate divides rating scores into three levels and these levels can be distinguished by using different background colors. By default background colors are the same, but you can assign them to reflect three levels using the `colors` attribute, and their two thresholds can be defined by `low-threshold` and `high-threshold`.
:::demo Rate divides rating scores into several levels and these levels can be distinguished by using different background colors. By default background colors are the same, but you can assign them an array with three element to reflect three levels using the `colors` attribute, and their two thresholds can be defined by `low-threshold` and `high-threshold`, or you can assign them with a object which key is the threshold between two levels and value is the corresponding color.
```html
```html
<divclass="block">
<divclass="block">
...
@@ -15,7 +15,7 @@ Used for rating
...
@@ -15,7 +15,7 @@ Used for rating
<spanclass="demonstration">Color for different levels</span>
<spanclass="demonstration">Color for different levels</span>
<el-rate
<el-rate
v-model="value2"
v-model="value2"
:colors="['#99A9BF', '#F7BA2A', '#FF9900']">
:colors="colors">
</el-rate>
</el-rate>
</div>
</div>
...
@@ -24,7 +24,8 @@ Used for rating
...
@@ -24,7 +24,8 @@ Used for rating
data(){
data(){
return{
return{
value1:null,
value1:null,
value2:null
value2:null,
colors:['#99A9BF','#F7BA2A','#FF9900']// same as { 2: '#99A9BF', 4: { value: '#F7BA2A', excluded: true }, 5: '#FF9900' }
}
}
}
}
}
}
...
@@ -61,12 +62,12 @@ Using text to indicate rating score
...
@@ -61,12 +62,12 @@ Using text to indicate rating score
You can use different icons to distinguish different rate components.
You can use different icons to distinguish different rate components.
:::demo You can customize icons for three different levels using `icon-classes`. In this example, we also use `void-icon-class` to set the icon if it is unselected.
:::demo You can customize icons by passing `icon-classes` an array with three elements or a object which key is the threshold between two levels and value is the corresponding icon class. In this example, we also use `void-icon-class` to set the icon if it is unselected.
| low-threshold | threshold value between low and medium level. The value itself will be included in low level | number | — | 2 |
| low-threshold | threshold value between low and medium level. The value itself will be included in low level | number | — | 2 |
| high-threshold | threshold value between medium and high level. The value itself will be included in high level | number | — | 4 |
| high-threshold | threshold value between medium and high level. The value itself will be included in high level | number | — | 4 |
| colors | color array for icons. It should have 3 elements, each of which corresponds with a score level | array | — | ['#F7BA2A', '#F7BA2A', '#F7BA2A'] |
| colors | colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color | array/object | — | ['#F7BA2A', '#F7BA2A', '#F7BA2A'] |
| void-color | color of unselected icons | string | — | #C6D1DE |
| void-color | color of unselected icons | string | — | #C6D1DE |
| disabled-void-color | color of unselected read-only icons | string | — | #EFF2F7 |
| disabled-void-color | color of unselected read-only icons | string | — | #EFF2F7 |
| icon-classes | array of class names of icons. It should have 3 elements, each of which corresponds with a score level | array | — | ['el-icon-star-on', 'el-icon-star-on','el-icon-star-on'] |
| icon-classes | class names of icons. If array, ot should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon class | array/object | — | ['el-icon-star-on', 'el-icon-star-on','el-icon-star-on'] |
| void-icon-class | class name of unselected icons | string | — | el-icon-star-off |
| void-icon-class | class name of unselected icons | string | — | el-icon-star-off |
| disabled-void-icon-class | class name of unselected read-only icons | string | — | el-icon-star-on |
| disabled-void-icon-class | class name of unselected read-only icons | string | — | el-icon-star-on |
:::demo Clasificación divide las puntuaciones en tres niveles y estos niveles pueden distinguirse usando diferentes colores de fondo. Por defecto los colores de fondo son iguales, pero puedes asignarlos para reflejar los tres niveles usando el atributo `colors` y sus dos umbrales pueden ser definidos con `low-treshold` y `high-treshold`.
:::demo Clasificación divide las puntuaciones en tres niveles y estos niveles pueden distinguirse usando diferentes colores de fondo. Por defecto los colores de fondo son iguales, pero puedes asignarlos para reflejar los tres niveles usando el atributo `colors` y sus dos umbrales pueden ser definidos con `low-treshold` y `high-treshold`. Or you can assign them with a object which key is the threshold between two levels and value is the corresponding color.
```html
```html
...
@@ -16,7 +16,7 @@ Usado para la calificación
...
@@ -16,7 +16,7 @@ Usado para la calificación
<spanclass="demonstration">Color for different levels</span>
<spanclass="demonstration">Color for different levels</span>
<el-rate
<el-rate
v-model="value2"
v-model="value2"
:colors="['#99A9BF', '#F7BA2A', '#FF9900']">
:colors="colors">
</el-rate>
</el-rate>
</div>
</div>
...
@@ -25,7 +25,8 @@ Usado para la calificación
...
@@ -25,7 +25,8 @@ Usado para la calificación
data(){
data(){
return{
return{
value1:null,
value1:null,
value2:null
value2:null,
colors:['#99A9BF','#F7BA2A','#FF9900']// same as { 2: '#99A9BF', 4: { value: '#F7BA2A', excluded: true }, 5: '#FF9900' }
}
}
}
}
}
}
...
@@ -62,12 +63,12 @@ Usa texto para indicar la puntuación
...
@@ -62,12 +63,12 @@ Usa texto para indicar la puntuación
Puede utilizar iconos para diferenciar cada componente.
Puede utilizar iconos para diferenciar cada componente.
:::demo Puede customizar iconos para tres niveles diferentes usando `icon-classes`. En este ejemplo también usamos `void-icon-class` para asignar un icono si no está seleccionado.
:::demo You can customize icons by passing `icon-classes` an array with three elements or a object which key is the threshold between two levels and value is the corresponding icon class. En este ejemplo también usamos `void-icon-class` para asignar un icono si no está seleccionado.
@@ -76,7 +77,8 @@ Puede utilizar iconos para diferenciar cada componente.
...
@@ -76,7 +77,8 @@ Puede utilizar iconos para diferenciar cada componente.
exportdefault{
exportdefault{
data(){
data(){
return{
return{
value:null
value:null,
iconClasses:['icon-rate-face-1','icon-rate-face-2','icon-rate-face-3']// same as { 2: 'icon-rate-face-1', 4: { value: 'icon-rate-face-2', excluded: true }, 5: 'icon-rate-face-3' }
}
}
}
}
}
}
...
@@ -120,10 +122,10 @@ La calificación de solo lectura es para mostrar la puntuación. Soporta media e
...
@@ -120,10 +122,10 @@ La calificación de solo lectura es para mostrar la puntuación. Soporta media e
| allow-half | si escoger media estrella está permitido | boolean | — | false |
| allow-half | si escoger media estrella está permitido | boolean | — | false |
| low-threshold | valor del umbral entre nivel bajo y medio. El valor será incluido en el nivel bajo | number | — | 2 |
| low-threshold | valor del umbral entre nivel bajo y medio. El valor será incluido en el nivel bajo | number | — | 2 |
| high-threshold | valor del umbral entre nivel bajo y medio. El valor será incluido en el nivel alto | number | — | 4 |
| high-threshold | valor del umbral entre nivel bajo y medio. El valor será incluido en el nivel alto | number | — | 4 |
| colors | arreglo de colores para iconos. Debe tener 3 elementos, cada uno corresponde a un nivel de puntuación | array | — | ['#F7BA2A', '#F7BA2A', '#F7BA2A'] |
| colors | colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color | array/object | — | ['#F7BA2A', '#F7BA2A', '#F7BA2A'] |
| void-color | color para iconos no seleccionados | string | — | #C6D1DE |
| void-color | color para iconos no seleccionados | string | — | #C6D1DE |
| disabled-void-color | color para las iconos no seleccionados de solo lectura | string | — | #EFF2F7 |
| disabled-void-color | color para las iconos no seleccionados de solo lectura | string | — | #EFF2F7 |
| icon-classes | arreglo de nombres para clases de iconos. Debe tener 3 elementos, cada uno corresponde a un nivel de puntuación | array | — | ['el-icon-star-on', 'el-icon-star-on','el-icon-star-on'] |
| icon-classes | class names of icons. If array, ot should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon class | array/object | — | ['el-icon-star-on', 'el-icon-star-on','el-icon-star-on'] |
| void-icon-class | nombre de clase para iconos no seleccionados | string | — | el-icon-star-off |
| void-icon-class | nombre de clase para iconos no seleccionados | string | — | el-icon-star-off |
| disabled-void-icon-class | nombre de clase para elementos no seleccionados de solo lectura | string | — | el-icon-star-on |
| disabled-void-icon-class | nombre de clase para elementos no seleccionados de solo lectura | string | — | el-icon-star-on |
@@ -4,7 +4,7 @@ Utilisé pour donner une note sur cinq étoiles.
...
@@ -4,7 +4,7 @@ Utilisé pour donner une note sur cinq étoiles.
### Usage
### Usage
:::demo Rate divise les scores en trois niveaux et ces niveaux peuvent être distingués en utilisant différentes couleurs de fond. Par défaut ces couleurs sont identiques, mais vous pouvez affecter un tableau des codes couleur à l'attribut `colors`, ainsi que les deux seuils via `low-threshold` et `high-threshold`.
:::demo Rate divise les scores en trois niveaux et ces niveaux peuvent être distingués en utilisant différentes couleurs de fond. Par défaut ces couleurs sont identiques, mais vous pouvez affecter un tableau des codes couleur à l'attribut `colors`, ainsi que les deux seuils via `low-threshold` et `high-threshold`. Or you can assign them with a object which key is the threshold between two levels and value is the corresponding color.
```html
```html
<divclass="block">
<divclass="block">
...
@@ -15,7 +15,7 @@ Utilisé pour donner une note sur cinq étoiles.
...
@@ -15,7 +15,7 @@ Utilisé pour donner une note sur cinq étoiles.
<spanclass="demonstration">Couleurs pour chaque niveau</span>
<spanclass="demonstration">Couleurs pour chaque niveau</span>
<el-rate
<el-rate
v-model="value2"
v-model="value2"
:colors="['#99A9BF', '#F7BA2A', '#FF9900']">
:colors="colors">
</el-rate>
</el-rate>
</div>
</div>
...
@@ -24,7 +24,8 @@ Utilisé pour donner une note sur cinq étoiles.
...
@@ -24,7 +24,8 @@ Utilisé pour donner une note sur cinq étoiles.
data(){
data(){
return{
return{
value1:null,
value1:null,
value2:null
value2:null,
colors:['#99A9BF','#F7BA2A','#FF9900']// same as { 2: '#99A9BF', 4: { value: '#F7BA2A', excluded: true }, 5: '#FF9900' }
}
}
}
}
}
}
...
@@ -61,12 +62,12 @@ Vous pouvez ajouter du texte à chaque score.
...
@@ -61,12 +62,12 @@ Vous pouvez ajouter du texte à chaque score.
Vous pouvez utiliser différentes icônes pour chaque
Vous pouvez utiliser différentes icônes pour chaque
:::demo Vous pouvez personnaliser les icônes de chaque niveau en utilisant `icon-classes`. Dans cet exemple, nous utilisons aussi `void-icon-class` qui permet de choisir l'icône des valeurs non-sélectionnées.
:::demo You can customize icons by passing `icon-classes` an array with three elements or a object which key is the threshold between two levels and value is the corresponding icon class. Dans cet exemple, nous utilisons aussi `void-icon-class` qui permet de choisir l'icône des valeurs non-sélectionnées.
@@ -75,9 +76,10 @@ Vous pouvez utiliser différentes icônes pour chaque
...
@@ -75,9 +76,10 @@ Vous pouvez utiliser différentes icônes pour chaque
exportdefault{
exportdefault{
data(){
data(){
return{
return{
value:null
value:null,
iconClasses:['icon-rate-face-1','icon-rate-face-2','icon-rate-face-3']// same as { 2: 'icon-rate-face-1', 4: { value: 'icon-rate-face-2', excluded: true }, 5: 'icon-rate-face-3' }
}
}
}
}
}
}
</script>
</script>
```
```
...
@@ -120,10 +122,10 @@ Le score peut être en lecture seule. Les demi-étoiles sont supportées.
...
@@ -120,10 +122,10 @@ Le score peut être en lecture seule. Les demi-étoiles sont supportées.
| allow-half | Si les demi-étoiles sont autorisées. | boolean | — | false |
| allow-half | Si les demi-étoiles sont autorisées. | boolean | — | false |
| low-threshold | Seuil entre les niveaux bas et moyen. La valeur sera incluse dans le niveau bas. | number | — | 2 |
| low-threshold | Seuil entre les niveaux bas et moyen. La valeur sera incluse dans le niveau bas. | number | — | 2 |
| high-threshold | Seuil entre les niveaux moyen et haut. La valeur sera incluse entre dans le niveau haut. | number | — | 4 |
| high-threshold | Seuil entre les niveaux moyen et haut. La valeur sera incluse entre dans le niveau haut. | number | — | 4 |
| colors | Couleurs des icônes. Doit en contenir trois, correspondants à chaque niveau. | array | — | ['#F7BA2A', '#F7BA2A', '#F7BA2A'] |
| colors | colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color. | array/object | — | ['#F7BA2A', '#F7BA2A', '#F7BA2A'] |
| disabled-void-color | Couleur des icônes non-sélectionnées en lecture seule. | string | — | #EFF2F7 |
| disabled-void-color | Couleur des icônes non-sélectionnées en lecture seule. | string | — | #EFF2F7 |
| icon-classes | Liste des classes des icônes. Doit en contenir trois, correspondants à chaque niveau. | array | — | ['el-icon-star-on', 'el-icon-star-on','el-icon-star-on'] |
| icon-classes | class names of icons. If array, ot should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon class. | array/object | — | ['el-icon-star-on', 'el-icon-star-on','el-icon-star-on'] |
| void-icon-class | Classe des icônes non-sélectionnées. | string | — | el-icon-star-off |
| void-icon-class | Classe des icônes non-sélectionnées. | string | — | el-icon-star-off |
| disabled-void-icon-class | Classe des icônes non-sélectionnées en lecture seule. | string | — | el-icon-star-on |
| disabled-void-icon-class | Classe des icônes non-sélectionnées en lecture seule. | string | — | el-icon-star-on |
| show-text | Si du texte doit apparaître à droite des étoiles. | boolean | — | false |
| show-text | Si du texte doit apparaître à droite des étoiles. | boolean | — | false |
/** Threshold value between medium and high level. The value itself will be included in high level */
/** Threshold value between medium and high level. The value itself will be included in high level */
highThreshold:number
highThreshold:number
/** Color array for icons. It should have 3 elements, each of which corresponds with a score level */
/** Colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color */
/** Array of class names of icons. It should have 3 elements, each of which corresponds with a score level */
/** Class names of icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding class name */