<!-- Animation circulaire à afficher durant les chargements -->

<template>
  <v-overlay :value="loading" class="loading-page">
    <v-progress-circular
      indeterminate
      size="64"
    />
  </v-overlay>
</template>

<script lang="ts">
import { defineComponent, ref, Ref } from '@nuxtjs/composition-api'

export default defineComponent({
  setup () {
    const loading: Ref<boolean> = ref(false)

    const set = (_num: number) => {
      loading.value = true
    }
    const start = () => {
      loading.value = true
    }
    const finish = () => {
      loading.value = false
    }
    const fail = () => {
      loading.value = false
    }

    return {
      loading,
      start,
      finish,
      fail,
      set
    }
  }
})
</script>

<style scoped>
  .loading-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001!important;
  }
</style>
