Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fe-app-h5
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万亚飞
fe-app-h5
Commits
3724e420
Commit
3724e420
authored
Jun 02, 2019
by
万亚飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置优化
parent
df17ed68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
App.jsx
src/App.jsx
+17
-16
No files found.
src/App.jsx
View file @
3724e420
import
React
from
'react'
;
import
React
,
{
Suspense
,
lazy
}
from
'react'
;
import
{
withRouter
,
NavLink
,
Switch
,
Route
,
Redirect
}
from
'react-router-dom'
;
import
{
withRouter
,
NavLink
,
Switch
,
Route
,
Redirect
}
from
'react-router-dom'
;
import
Home
from
'./pages/home'
;
import
Home
from
'./pages/home'
;
import
JobList
from
'./pages/user/JobList'
;
const
JobList
=
lazy
(()
=>
import
(
'./pages/user/JobList'
));
import
AddMaterial
from
'./pages/user/addMaterial'
;
const
AddMaterial
=
lazy
(()
=>
import
(
'./pages/user/addMaterial'
));
import
TrainList
from
'./pages/user/TrainList'
;
const
TrainList
=
lazy
(()
=>
import
(
'./pages/user/TrainList'
));
import
Train
from
'./pages/user/Train'
;
const
Train
=
lazy
(()
=>
import
(
'./pages/user/Train'
));
import
Pay
from
'./pages/pay/pay'
;
import
NotFind
from
'./pages/404'
;
import
NotFind
from
'./pages/404'
;
import
storage
from
'@/utils/storage.plugin'
;
import
storage
from
'@/utils/storage.plugin'
;
import
vc
from
'@/utils/vconsole'
;
import
vc
from
'@/utils/vconsole'
;
//第二页,分类模块的文件使用react-loadable按需加载并且代码分割
//第二页,分类模块的文件使用react-loadable按需加载并且代码分割
class
App
extends
React
.
Component
{
class
App
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -52,16 +52,17 @@ class App extends React.Component {
...
@@ -52,16 +52,17 @@ class App extends React.Component {
return
(
return
(
<
div
className=
"container"
>
<
div
className=
"container"
>
<
div
className=
"page-content"
>
<
div
className=
"page-content"
>
<
Switch
>
<
Suspense
fallback=
{
<
div
/>
}
>
<
Route
path=
"/user/job/add"
key=
"add-job"
component=
{
AddMaterial
}
/>
<
Switch
>
<
Route
path=
"/user/job/:id"
key=
"edit-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job/add"
key=
"add-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job"
component=
{
JobList
}
/>
<
Route
path=
"/user/job/:id"
key=
"edit-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/train/add"
key=
"add-train"
component=
{
Train
}
/>
<
Route
path=
"/user/job"
component=
{
JobList
}
/>
<
Route
path=
"/user/train/:id"
key=
"edit-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train/add"
key=
"add-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train"
component=
{
TrainList
}
/>
<
Route
path=
"/user/train/:id"
key=
"edit-train"
component=
{
Train
}
/>
<
Route
path=
"/pay"
component=
{
Pay
}
/>
<
Route
path=
"/user/train"
component=
{
TrainList
}
/>
<
Route
component=
{
JobList
}
/>
<
Route
component=
{
JobList
}
/>
</
Switch
>
</
Switch
>
</
Suspense
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment