Loading.vue 911 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. const fail = () => {
  25. loading.value = false
  26. }
  27. return {
  28. loading,
  29. start,
  30. finish,
  31. fail,
  32. set
  33. }
  34. }
  35. })
  36. </script>
  37. <style scoped>
  38. .loading-page {
  39. position: fixed;
  40. top: 0;
  41. left: 0;
  42. width: 100%;
  43. height: 100%;
  44. z-index: 1001!important;
  45. }
  46. </style>