定义全局loding
This commit is contained in:
22
src/App.vue
22
src/App.vue
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user