Skip to content

Commit

Permalink
feat: ✨ 打印错误日志
Browse files Browse the repository at this point in the history
  • Loading branch information
G committed Dec 27, 2023
1 parent bd18dda commit 956b104
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions apps/admin/src/components/LazyLoad/src/LazyLoad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import Loading from './Loading';
* @param {Element} Component 需要访问的组件
* @returns element
*/
const LazyLoad = (Component: LazyExoticComponent<React.FC<{}>>): ReactNode => (
<Suspense fallback={<Loading />}>
<Component />
</Suspense>
);
const LazyLoad = (Component: LazyExoticComponent<React.FC<{}>>): ReactNode => {
console.log(Component);

return (
<Suspense fallback={<Loading />}>
<Component />
</Suspense>
);
};

export default LazyLoad;
2 changes: 1 addition & 1 deletion apps/admin/src/router/routes/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const HomeRoute: RouteObject = {
children: [
{
path: '',
element: LazyLoad(lazy(async () => await import('@/views/home'))),
element: LazyLoad(lazy(() => import('@/views/home'))),
meta: {
title: '首页',
key: 'home',
Expand Down

0 comments on commit 956b104

Please sign in to comment.