Ant-design-pro: V5如何写一个全局loading遮罩🧐[问题]

Created on 27 Aug 2020  ·  2Comments  ·  Source: ant-design/ant-design-pro

🧐 问题描述

请问如何做一个全局的loading遮罩,比如我数据提交的时候,要整个窗口都被loading遮住,但是目前我只能在pages里写,只能遮住当前page,无法遮住layout部分,因为V5的layout是插件生成的

🕵🏻‍♀️ question

Most helpful comment

这个和布局无关,只要css即可,例如:

// 样式文件
.mask {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  margin: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, .3);
}

// tsx
<div className={styles.mask}></div>

z-index可以按照实际情况调整

All 2 comments

这个和布局无关,只要css即可,例如:

// 样式文件
.mask {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  margin: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, .3);
}

// tsx
<div className={styles.mask}></div>

z-index可以按照实际情况调整

这个和布局无关,只要css即可,例如:

// 样式文件
.mask {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  margin: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, .3);
}

// tsx
<div className={styles.mask}></div>

z-index可以按照实际情况调整

用antd的Spin组件如何做?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaoqiang19514 picture gaoqiang19514  ·  3Comments

yjz1004 picture yjz1004  ·  3Comments

kaoding picture kaoding  ·  3Comments

yadongxie150 picture yadongxie150  ·  3Comments

ghost picture ghost  ·  3Comments