1
1
<template >
2
- <section :class =" { loading: showLoadingSpinner } " >
2
+ <section :class =" { loading: loading } " class = " relative " >
3
3
<slot name =" before" />
4
4
5
5
<div
23
23
class =" mb-6 w-full"
24
24
/>
25
25
26
- <div v-if =" showLoadingSpinner " class =" loading-spinner-wrapper" >
26
+ <div v-if =" loading " class =" loading-spinner-wrapper" >
27
27
<div class =" loading-spinner-wrapper-container" >
28
28
<sba-loading-spinner size =" sm" />
29
29
{{ $t('term.fetching_data') }}
@@ -60,20 +60,6 @@ export default {
60
60
}),
61
61
},
62
62
},
63
- data () {
64
- return {
65
- showLoadingSpinner: false ,
66
- debouncedLoader: null ,
67
- };
68
- },
69
- watch: {
70
- loading : function (newVal ) {
71
- window .clearTimeout (this .debouncedLoader );
72
- this .debouncedLoader = window .setTimeout (() => {
73
- this .showLoadingSpinner = newVal;
74
- }, 250 );
75
- },
76
- },
77
63
methods: {
78
64
classNames: classNames,
79
65
},
@@ -82,10 +68,26 @@ export default {
82
68
83
69
<style scoped>
84
70
.loading-spinner-wrapper {
85
- @apply w-full h-full flex flex-col bg-black /30 absolute z- 50 top- 0 left- 0 justify-center items-center backdrop-blur-sm ;
71
+ @apply absolute w-full h-screen flex flex-col z- 50 top- 0 left- 0 justify-center items-center opacity- 0;
72
+
73
+ animation-name : show ;
74
+ animation-duration : 0ms ;
75
+ animation-fill-mode : forwards ;
76
+ animation-delay : 250ms ;
77
+ animation-iteration-count : 1 ;
86
78
}
87
79
88
80
.loading-spinner-wrapper-container {
89
- @apply rounded-md bg-black /30 py- 4 px- 5 flex w-auto gap- 4 flex items-center text-white backdrop-blur ;
81
+ @apply rounded-md bg-black /30 py- 4 px- 5 flex w-auto gap- 4 items-center text-white ;
82
+ }
83
+
84
+ @keyframes show {
85
+ from {
86
+ @apply opacity- 0;
87
+ }
88
+
89
+ to {
90
+ @apply opacity- 100;
91
+ }
90
92
}
91
93
</style >
0 commit comments