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"
|
||||
rel="noopener noreferrer">文档</a>
|
||||
</div>
|
||||
<text>
|
||||
<div style={{color: 'rgba(0, 0, 0, .45)'}}>
|
||||
Copyright <Icon type="copyright"/> 2019 By OpenSpug
|
||||
</text>
|
||||
</div>
|
||||
</div>
|
||||
</Layout.Footer>
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (c) <spug.dev@gmail.com>
|
||||
* 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 (
|
||||
<Switch>
|
||||
{this.routes.map(route => <Route exact strict key={route.path} {...route}/>)}
|
||||
<Route component={NotFound}/>
|
||||
</Switch>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Switch>
|
||||
{this.routes.map(route => <Route exact strict key={route.path} {...route}/>)}
|
||||
<Route component={NotFound}/>
|
||||
</Switch>
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
* Copyright (c) <spug.dev@gmail.com>
|
||||
* 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'))),
|
||||
]
|
||||
|
|
|
@ -110,7 +110,7 @@ class LoginIndex extends React.Component {
|
|||
<a title="文档" href="https://www.spug.dev/docs/about-spug/" target="_blank"
|
||||
rel="noopener noreferrer">文档</a>
|
||||
</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>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue