GlobalLoading.vue
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<script setup lang="ts">
import { useAppStore } from "@/stores";
const appStore = useAppStore();
</script>
<template>
<Transition name="fade">
<div v-if="appStore.loading" class="global-loading">
<div class="loading-content">
<div class="loading-spinner"></div>
<p class="loading-text">
正在加载子应用...
</p>
</div>
</div>
</Transition>
</template>
<style scoped>
.global-loading {
position: absolute;
top: 0;
left: 0;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background: rgb(255 255 255 / 80%);
backdrop-filter: blur(4px);
}
.loading-content {
display: flex;
flex-direction: column;
gap: 16px;
align-items: center;
}
.loading-spinner {
width: 48px;
height: 48px;
border: 4px solid #f3f3f3;
border-top: 4px solid #1890ff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
.loading-text {
margin: 0;
font-size: 14px;
color: #666;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>