Loading.vue 838 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!-- Animation circulaire à afficher durant les chargements -->
  2. <template>
  3. <v-overlay :value="loading" class="loading-page">
  4. <v-progress-circular
  5. indeterminate
  6. size="64"
  7. />
  8. </v-overlay>
  9. </template>
  10. <script lang="ts">
  11. import { defineComponent, ref, Ref } from '@nuxtjs/composition-api'
  12. export default defineComponent({
  13. setup () {
  14. const loading: Ref<boolean> = ref(false)
  15. const set = (num: number) => {
  16. loading.value = true
  17. }
  18. const start = () => {
  19. loading.value = true
  20. }
  21. const finish = () => {
  22. loading.value = false
  23. }
  24. return {
  25. loading,
  26. start,
  27. finish,
  28. set
  29. }
  30. }
  31. })
  32. </script>
  33. <style scoped>
  34. .loading-page {
  35. position: fixed;
  36. top: 0;
  37. left: 0;
  38. width: 100%;
  39. height: 100%;
  40. z-index: 100!important;
  41. }
  42. </style>