Loading.vue 771 B

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