All files / src/components carousel-numbers.vue

0% Statements 0/26
0% Branches 0/2
0% Functions 0/13
0% Lines 0/26

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74                                                                                                                                                   
<template>
  <!-- Компонент данных: Отображает цифры в виде слайд-группы карточек с анимацией счетчика -->
  <v-card class="d-flex ml-3">
    <v-sheet class="mx-auto" elevation="0" max-width="813">
      <v-slide-group v-model="model" class="pa-0" mandatory selected-class="bg-primary" show-arrows>
        <v-slide-group-item v-for="n in digitalData" :key="n">
          <v-card class="ma-2 mt-4 d-flex flex-column" elevation="0" height="100" width="169">
            <v-card class="h-100 text-center g text-black_grey">
              <v-card-title class="statstyle my-2 py-0 text-overline font-weight-bold">
                {{ n.status }}
              </v-card-title>
              <v-card-text class="numstyle mt-4 py-0 font-weight-bold">
                <vue3-autocounter
                  ref="counter"
                  :duration="1"
                  :endAmount="Number(n.num)"
                  :startAmount="0"
                />
              </v-card-text>
            </v-card>
          </v-card>
        </v-slide-group-item>
      </v-slide-group>
    </v-sheet>
  </v-card>
</template>
 
<script>
import { ref } from 'vue';
import { baseURL } from '@/utils/axios-api';

export default {
  props: {
    digitalData: {
      type: Object,
      default: () => {},
      comment: 'Объект с данными для отображения',
    },
  },

  setup() {
    /**
     * Получает базовый URL из конфигурации axios.
     */
    const burl = baseURL.slice(0, -1);
 
    /**
     * Хранит выбранное значение модели для v-slide-group.
     */
    const model = ref(false);
 
    return { model, burl };
  },
};
</script>

<style>
.numstyle {
  font-size: 2.875rem !important;
  line-height: 2.5rem !important;
  font-family: cursive !important;
  background: #ffffffb0;
}

.statstyle {
  background: #ffffffb0;
  font-size: 1rem !important;
}

.g {
  background-color: rgb(255, 255, 255);
}
</style>