-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvRating.vue
52 lines (48 loc) · 1.3 KB
/
vRating.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<div class="v-rating">
<div class="v-rating-wrapper">
<v-rating-icons :icons="icons" :value="value" :filled="true" :size="size" :color="color" :filled_color="filled_color"></v-rating-icons>
<v-rating-icons :icons="icons" :value="value" :size="size" :color="color" :filled_color="filled_color"></v-rating-icons>
</div>
</div>
</template>
<script>
import vRatingIcons from "./vRatingIcons";
export default {
name: 'v-rating',
props: {
value: {
type: String | Number,
default: 0
},
size: {
type: Number,
default: 10
},
max: {
type: Number,
default: 5
},
color: {
type: String,
default: '#828b93'
},
filled_color: {
type: String,
default: '#ffc107'
},
},
computed: {
icons() {
let icons = [];
for (let i = 0; i < this.max; i++) {
icons.push(i);
}
return icons;
}
},
components: {
vRatingIcons
}
};
</script>