Skip to content

Commit

Permalink
feat: ✨ ceshi
Browse files Browse the repository at this point in the history
  • Loading branch information
G committed Dec 27, 2023
1 parent 46583e9 commit 16a5f53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/admin/src/router/routes/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { LayoutGuard } from '../guard';
import type { RouteObject } from '../types';

import HomePage from '@/views/home/index';
import { delayForComponent } from '../utils/delayPromise';

// Home route
const HomeRoute: RouteObject = {
Expand All @@ -22,7 +23,7 @@ const HomeRoute: RouteObject = {
children: [
{
path: '',
element: <HomePage />,
element: LazyLoad(lazy(() => delayForComponent(import('@/views/home/index')))),
meta: {
title: '首页',
key: 'home',
Expand Down
7 changes: 7 additions & 0 deletions apps/admin/src/router/utils/delayPromise.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { FC } from 'react';

export function delayForComponent(promise: any) {
return new Promise((resolve) => {
setTimeout(resolve, 2000);
}).then(() => promise);
}

0 comments on commit 16a5f53

Please sign in to comment.