From c5fc903cce5dcd67bca07f0ac4014a71511bf356 Mon Sep 17 00:00:00 2001 From: vapao Date: Sat, 18 Jan 2020 10:12:00 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/layout/Footer.js | 4 ++-- spug_web/src/libs/router.js | 12 +++++++----- spug_web/src/pages/home/routes.js | 7 +++---- spug_web/src/pages/login/index.js | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/spug_web/src/layout/Footer.js b/spug_web/src/layout/Footer.js index f413985..cd0cbad 100644 --- a/spug_web/src/layout/Footer.js +++ b/spug_web/src/layout/Footer.js @@ -21,9 +21,9 @@ export default class extends React.Component { 文档 - +
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
)