Vue中配置
<template><div class="loading"><img src="./../assets/img/loading.gif" alt=""></div></template><script>export default {name: 'LOADING',data () {return {}},}</script><style scoped>.loading{position: fixed;top:0;left:0;z-index:121;width: 100%;height: 100%;background: rgba(0,0,0,0.3);display: table-cell;vertical-align: middle;text-align: center;}.loading img{width: 1rem;height: 1rem;margin:7.5rem auto;}</style>
然后做一个if判断

