// 定义静态路由
import NotFound from '@/pages/notFound'
import mapRoutes from '@/router-handle/mapRoutes'
import { Navigate, RouteObject } from 'react-router-dom'
const syncRoutes: MyRouteObject[] = [
{
path: '/',
element: ,
errorElement:
},
{
path: '/login',
lazy: async () => {
const Login = await import('@/pages/login')
return {
Component: Login.default
}
}
},
{
path: '/home',
children: [...mapRoutes()],
lazy: async () => {
const Home = await import('@/pages/home')
return {
Component: Home.default
}
}
},
{
path: '*',
element:
}
]
export type MyRouteObject = Omit & {
name?: string
icon?: any
highIcon?: any
children?: MyRouteObject[]
}
export default syncRoutes