mirror of https://github.com/openspug/spug
U 优化前端加载
parent
6e742a8c36
commit
c5fc903cce
|
@ -21,9 +21,9 @@ export default class extends React.Component {
|
||||||
<a title="文档" href="https://www.spug.dev/docs/about-spug/" target="_blank"
|
<a title="文档" href="https://www.spug.dev/docs/about-spug/" target="_blank"
|
||||||
rel="noopener noreferrer">文档</a>
|
rel="noopener noreferrer">文档</a>
|
||||||
</div>
|
</div>
|
||||||
<text>
|
<div style={{color: 'rgba(0, 0, 0, .45)'}}>
|
||||||
Copyright <Icon type="copyright"/> 2019 By OpenSpug
|
Copyright <Icon type="copyright"/> 2019 By OpenSpug
|
||||||
</text>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Layout.Footer>
|
</Layout.Footer>
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Copyright (c) <spug.dev@gmail.com>
|
* Copyright (c) <spug.dev@gmail.com>
|
||||||
* Released under the MIT License.
|
* Released under the MIT License.
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React, { Suspense } from 'react';
|
||||||
import { Switch, Route } from 'react-router-dom';
|
import { Switch, Route } from 'react-router-dom';
|
||||||
import moduleRoutes from '../routes';
|
import moduleRoutes from '../routes';
|
||||||
import styles from './libs.module.css';
|
import styles from './libs.module.css';
|
||||||
|
@ -53,10 +53,12 @@ export class Router extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<Switch>
|
<Switch>
|
||||||
{this.routes.map(route => <Route exact strict key={route.path} {...route}/>)}
|
{this.routes.map(route => <Route exact strict key={route.path} {...route}/>)}
|
||||||
<Route component={NotFound}/>
|
<Route component={NotFound}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
</Suspense>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
* Copyright (c) <spug.dev@gmail.com>
|
* Copyright (c) <spug.dev@gmail.com>
|
||||||
* Released under the MIT License.
|
* Released under the MIT License.
|
||||||
*/
|
*/
|
||||||
import { makeRoute } from "../../libs/router";
|
import { lazy } from 'react';
|
||||||
import Index from './index';
|
import { makeRoute } from 'libs/router';
|
||||||
|
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
makeRoute('', Index),
|
makeRoute('', lazy(() => import('./index'))),
|
||||||
]
|
]
|
||||||
|
|
|
@ -110,7 +110,7 @@ class LoginIndex extends React.Component {
|
||||||
<a title="文档" href="https://www.spug.dev/docs/about-spug/" target="_blank"
|
<a title="文档" href="https://www.spug.dev/docs/about-spug/" target="_blank"
|
||||||
rel="noopener noreferrer">文档</a>
|
rel="noopener noreferrer">文档</a>
|
||||||
</div>
|
</div>
|
||||||
<text >Copyright <Icon type="copyright" /> 2019 By OpenSpug</text>
|
<div style={{color: 'rgba(0, 0, 0, .45)'}}>Copyright <Icon type="copyright" /> 2019 By OpenSpug</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue