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
Home
from
'./pages/home'
;
import
JobList
from
'./pages/user/JobList'
;
import
AddMaterial
from
'./pages/user/addMaterial'
;
import
TrainList
from
'./pages/user/TrainList'
;
import
Train
from
'./pages/user/Train'
;
import
Pay
from
'./pages/pay/pay'
;
const
JobList
=
lazy
(()
=>
import
(
'./pages/user/JobList'
));
const
AddMaterial
=
lazy
(()
=>
import
(
'./pages/user/addMaterial'
));
const
TrainList
=
lazy
(()
=>
import
(
'./pages/user/TrainList'
));
const
Train
=
lazy
(()
=>
import
(
'./pages/user/Train'
));
import
NotFind
from
'./pages/404'
;
import
storage
from
'@/utils/storage.plugin'
;
import
vc
from
'@/utils/vconsole'
;
//第二页,分类模块的文件使用react-loadable按需加载并且代码分割
class
App
extends
React
.
Component
{
constructor
(
props
)
{
...
...
@@ -52,16 +52,17 @@ class App extends React.Component {
return
(
<
div
className=
"container"
>
<
div
className=
"page-content"
>
<
Switch
>
<
Route
path=
"/user/job/add"
key=
"add-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job/:id"
key=
"edit-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job"
component=
{
JobList
}
/>
<
Route
path=
"/user/train/add"
key=
"add-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train/:id"
key=
"edit-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train"
component=
{
TrainList
}
/>
<
Route
path=
"/pay"
component=
{
Pay
}
/>
<
Route
component=
{
JobList
}
/>
</
Switch
>
<
Suspense
fallback=
{
<
div
/>
}
>
<
Switch
>
<
Route
path=
"/user/job/add"
key=
"add-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job/:id"
key=
"edit-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job"
component=
{
JobList
}
/>
<
Route
path=
"/user/train/add"
key=
"add-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train/:id"
key=
"edit-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train"
component=
{
TrainList
}
/>
<
Route
component=
{
JobList
}
/>
</
Switch
>
</
Suspense
>
</
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