+
Copyright 2019 By OpenSpug
-
+
)
diff --git a/spug_web/src/libs/router.js b/spug_web/src/libs/router.js
index 8570cc9..77c8ac2 100644
--- a/spug_web/src/libs/router.js
+++ b/spug_web/src/libs/router.js
@@ -3,7 +3,7 @@
* Copyright (c)
* Released under the MIT License.
*/
-import React from 'react';
+import React, { Suspense } from 'react';
import { Switch, Route } from 'react-router-dom';
import moduleRoutes from '../routes';
import styles from './libs.module.css';
@@ -53,10 +53,12 @@ export class Router extends React.Component {
render() {
return (
-
- {this.routes.map(route => )}
-
-
+ Loading...}>
+
+ {this.routes.map(route => )}
+
+
+
)
}
}
diff --git a/spug_web/src/pages/home/routes.js b/spug_web/src/pages/home/routes.js
index 365f9d3..eb83492 100644
--- a/spug_web/src/pages/home/routes.js
+++ b/spug_web/src/pages/home/routes.js
@@ -3,10 +3,9 @@
* Copyright (c)
* Released under the MIT License.
*/
-import { makeRoute } from "../../libs/router";
-import Index from './index';
-
+import { lazy } from 'react';
+import { makeRoute } from 'libs/router';
export default [
- makeRoute('', Index),
+ makeRoute('', lazy(() => import('./index'))),
]
diff --git a/spug_web/src/pages/login/index.js b/spug_web/src/pages/login/index.js
index 0cca032..79bfe48 100644
--- a/spug_web/src/pages/login/index.js
+++ b/spug_web/src/pages/login/index.js
@@ -110,7 +110,7 @@ class LoginIndex extends React.Component {
文档
- Copyright 2019 By OpenSpug
+ Copyright 2019 By OpenSpug
)