Skip to content

Commit

Permalink
feat: loading组件添加nprogress进度条
Browse files Browse the repository at this point in the history
  • Loading branch information
NLRX-WJC committed May 17, 2020
1 parent 46db71a commit 5f23122
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"jszip": "^3.4.0",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"nprogress": "^0.2.0",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-beautiful-dnd": "^13.0.0",
Expand Down
29 changes: 21 additions & 8 deletions src/components/Loading/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import React from "react";
import React, { Component } from "react";
import { Spin } from "antd";
const Loading = () => {
return (
<div className="app-container">
<Spin />
</div>
);
};
import NProgress from "nprogress"; // progress bar
import "nprogress/nprogress.css"; // progress bar style

NProgress.configure({ showSpinner: false })// NProgress Configuration

class Loading extends Component {
componentDidMount() {
NProgress.start()
}
componentWillUnmount() {
NProgress.done()
}
render() {
return (
<div className="app-container">
<Spin />
</div>
);
}
}

export default Loading;

0 comments on commit 5f23122

Please sign in to comment.