定义全局loding

This commit is contained in:
X1627315083
2025-10-23 14:05:42 +08:00
parent dab0bfaa5e
commit c454a16f04
4 changed files with 44 additions and 2 deletions

View File

@@ -1,9 +1,17 @@
<template>
<RouteCache />
<RouteCache />
<div id="loading" v-if="!loading">
<van-loading size="10rem" color="#0094ff"/>
</div>
</template>
<script setup lang="ts">
import RouteCache from '@/components/RouteCache.vue'
import { computed } from 'vue'
import { useOverallStore } from '@/stores'
const overallStore = useOverallStore()
const loading = computed(() => overallStore.loading)
</script>
<style lang="less">
@@ -41,4 +49,16 @@ import RouteCache from '@/components/RouteCache.vue'
}
/* touch-action: none; */
}
#loading {
position: fixed;
z-index: 999999999;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.3);
display: flex;
align-items: center;
justify-content: center;
}
</style>