页面跳转添加loading,添加全局loading
This commit is contained in:
23
src/App.vue
23
src/App.vue
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user