页面跳转添加loading,添加全局loading

This commit is contained in:
李志鹏
2025-12-12 10:34:10 +08:00
parent 652d89d3be
commit ed83044f81
6 changed files with 50 additions and 21 deletions

View File

@@ -1,7 +1,16 @@
<template>
<router-view/>
<div class="loading" v-show="loading"><a-spin delay="0.5" /></div>
</template>
<script setup>
import { computed } from 'vue';
import { useStore } from 'vuex';
const store = useStore();
const loading = computed(() => store.state.loading || store.state.view_loading);
</script>
<style lang="less">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
@@ -9,7 +18,19 @@
-moz-osx-font-smoothing: grayscale;
height: 100%;
}
.loading{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.4);
display: flex;
align-items: center;
justify-content: center;
z-index: 999999999999;
color: #fff;
}
.ipad{
*{
-webkit-touch-callout:none;