React 组件之加载图Loading

import React, { PureComponent } from "react";
import { ActivityIndicator } from "antd-mobile";

export default class Loading extends PureComponent {
  static defaultProps = {
    show: false
  };

  render() {
    const { show } = this.props;
    return (
      <div
        style={{
          display: show ? "block" : "none",
          transform: " translate(-50%,-50%)",
          position: "absolute",
          top: "50%",
          left: "50%",
          zIndex: 400
        }}
      >
        <ActivityIndicator size="large" />
      </div>
    );
  }
}


版权声明:本文为qq_36658051原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。