mirror of
https://litchi.icu/ngc2207/judge4c-demo.git
synced 2025-05-18 22:37:11 +00:00
feat: 添加代码片段加载页面并实现延迟加载
This commit is contained in:
parent
55bb2c7883
commit
8a91e46c4f
3
src/app/snippets/[id]/loading.tsx
Normal file
3
src/app/snippets/[id]/loading.tsx
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default function SnippetShowLoadingPage() {
|
||||||
|
return <div>Loading...</div>;
|
||||||
|
}
|
@ -8,6 +8,8 @@ interface SnippetShowPageProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function SnippetShowPage(props: SnippetShowPageProps) {
|
export default async function SnippetShowPage(props: SnippetShowPageProps) {
|
||||||
|
await new Promise((r) => setTimeout(r, 2000));
|
||||||
|
|
||||||
const params = await props.params;
|
const params = await props.params;
|
||||||
const snippet = await db.snippet.findFirst({
|
const snippet = await db.snippet.findFirst({
|
||||||
where: {
|
where: {
|
||||||
|
Loading…
Reference in New Issue
Block a user