You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.2 KiB

2 years ago
  1. <template>
  2. <v-card outlined class="rounded-xl px-3">
  3. <v-card-title> {{ $t('Rating')}} </v-card-title>
  4. <v-card-text>
  5. <v-checkbox v-for="i in starts" :key="'out-' + i" v-model="ratingChecked" :value="i" color="#F5CDA8" class="my-0">
  6. <template v-slot:label>
  7. <v-icon v-for="j in i" :key="'in-1-' + j" color="#EE9546">
  8. mdi-star
  9. </v-icon>
  10. <v-icon v-for="j in 5 - i" :key="'in-2-' + j" color="#EE9546">
  11. mdi-star-outline
  12. </v-icon>
  13. </template>
  14. </v-checkbox>
  15. </v-card-text>
  16. </v-card>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. ratingChecked: [],
  23. starts: Array(5)
  24. .fill(1)
  25. .map((_, i) => {
  26. return 5 - i;
  27. }),
  28. };
  29. },
  30. watch: {
  31. ratingChecked() {
  32. this.$emit("selectRating", this.ratingChecked);
  33. },
  34. },
  35. };
  36. </script>
  37. <style scoped lang="scss">
  38. :deep() {
  39. .v-text-field__details {
  40. display: none !important;
  41. }
  42. .v-input__append-inner {
  43. margin-top: 12px !important;
  44. }
  45. .v-input--selection-controls__input {
  46. i {
  47. color: #f5cda8 !important;
  48. }
  49. }
  50. .v-label {
  51. color: #232323 !important;
  52. margin-left: 20px;
  53. }
  54. }
  55. </style>