Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
138a8447
Commit
138a8447
authored
Feb 19, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
988cd561
Pipeline
#20270
passed with stages
in 4 minutes and 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
src/ui/LazyLoad.tsx
src/ui/LazyLoad.tsx
+3
-0
src/ui/Neos.tsx
src/ui/Neos.tsx
+16
-4
No files found.
src/ui/LazyLoad.tsx
View file @
138a8447
import
React
,
{
Suspense
}
from
"
react
"
;
// 这个组件不知道为啥用不了,先保留后面研究下
const
LazyLoad
=
(
props
:
{
lazy
:
React
.
ReactNode
})
=>
{
return
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
>
{
props
.
lazy
}
</
Suspense
>;
};
export
const
Loading
=
()
=>
<
div
>
Loading
</
div
>;
export
default
LazyLoad
;
src/ui/Neos.tsx
View file @
138a8447
import
React
,
{
Suspense
}
from
"
react
"
;
import
{
Routes
,
Route
}
from
"
react-router-dom
"
;
import
LazyLoad
from
"
./LazyLoad
"
;
import
LazyLoad
,
{
Loading
}
from
"
./LazyLoad
"
;
const
Login
=
React
.
lazy
(()
=>
import
(
"
./Login
"
));
const
WaitRoom
=
React
.
lazy
(()
=>
import
(
"
./WaitRoom
"
));
...
...
@@ -14,15 +14,27 @@ export default function () {
<
Route
path=
"/"
element=
{
<
LazyLoad
lazy=
{
<
Login
/>
}
/>
}
/>
<
Route
path=
"/room/:player/:passWd/:ip"
element=
{
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
><
WaitRoom
/></
Suspense
>
}
element=
{
<
Suspense
fallback=
{
<
Loading
/>
}
>
<
WaitRoom
/>
</
Suspense
>
}
/>
<
Route
path=
"/mora/:player/:passWd/:ip"
element=
{
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
><
Mora
/></
Suspense
>
}
element=
{
<
Suspense
fallback=
{
<
Loading
/>
}
>
<
Mora
/>
</
Suspense
>
}
/>
<
Route
path=
"/duel/:player/:passWd/:ip"
element=
{
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
><
NeosDuel
/></
Suspense
>
}
element=
{
<
Suspense
fallback=
{
<
Loading
/>
}
>
<
NeosDuel
/>
</
Suspense
>
}
/>
</
Routes
>
);
...
...
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