dashboard.tsx 875 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { lazy, Suspense } from 'react'
  2. import { Navigate, Outlet } from 'react-router'
  3. import type { AppRouteObject } from '#/router'
  4. import { SvgIcon } from '@/components/icon'
  5. import { CircleLoading } from '@/components/loading'
  6. const HomePage = lazy(() => import('@/pages/dashboard'))
  7. const dashboard: AppRouteObject = {
  8. order: 1,
  9. path: 'dashboard',
  10. element: (
  11. <Suspense fallback={<CircleLoading />}>
  12. <Outlet />
  13. </Suspense>
  14. ),
  15. meta: {
  16. label: 'sys.menu.dashboard',
  17. icon: <SvgIcon icon='ic-analysis' className='ant-menu-item-icon' size='24' />,
  18. key: '/dashboard'
  19. },
  20. children: [
  21. {
  22. index: true,
  23. element: <Navigate to='workbench' replace />
  24. },
  25. {
  26. path: 'workbench',
  27. element: <HomePage />,
  28. meta: { label: 'sys.menu.workbench', key: '/dashboard/workbench' }
  29. }
  30. ]
  31. }
  32. export default dashboard