antd-lazy-loading
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

antd-lazy-loading

Global loading indicator for antd, differd to show.

Installation

npm i antd-lazy-loading

Usage

Edit antd-lazy-loading

import React from "react";
import ReactDOM from "react-dom";
import * as lazyLoading from "antd-lazy-loading";
import { Button } from "antd";
import "antd/dist/antd.css";
 
import "./styles.css";
 
function App() {
  return (
    <div className="App" style={{ marginTop: "100px" }}>
      <div>
        <Button onClick={() => lazyLoading.pushRequest()}>Push Request</Button>
      </div>
      <div>
        <Button onClick={() => lazyLoading.popRequest()}>Pop Request</Button>
      </div>
      <div>
        <Button onClick={() => lazyLoading.pushRequest("Please wait")}>
          Push Request with custom text
        </Button>
      </div>
      <div>
        <Button onClick={() => lazyLoading.config("Custom loading", 0)}>
          Change global text and differ time
        </Button>
      </div>
    </div>
  );
}
 
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i antd-lazy-loading

    Weekly Downloads

    4

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    7.01 kB

    Total Files

    8

    Last publish

    Collaborators

    • wangsijie