请求状态窗遮挡loading

import { Spin } from 'ant-design-vue';
//定义变量
spinning: false//放在第一层级
<>
    <div className="aspin" v-show={this.spinning}>
          <antSpin spinning={this.spinning} />
    </div>
</>

//样式
.aspin{
  width: 100%;
  height: 100%;
  position: absolute;
  display: flex;
  z-index: 99;
  justify-content: center;
  align-items: center;
  background-color: #000;
  opacity: 0.5;
}

请求的时候将变量置为true,请求结束将状态置为false即可。
              

 

posted @ 2024-08-05 14:18  你风致  阅读(3)  评论(0编辑  收藏  举报