我写了一个没有数据的通用界面,当网络请求没有数据的时候显示。 主要代码如下,其实就是固定定位居中。
这个存在很严重的问题,就是后面的控制的点击事件全部被拦截了。找了半天也没找到解决方案。
.wrapper{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
pointer-events:none;
left: 0;
right: 0;
top:0;
bottom: 0;
}
最后发现只要设置下面这个属性就可以了。
pointer-events:none;
错误的方式:
设置z-index是没有效果的。