Browse Source

改用hash路由

main
李金 5 months ago
parent
commit
1ecf176fc7
  1. 4
      src/routes.tsx

4
src/routes.tsx

@ -20,6 +20,7 @@ import {
Outlet,
redirect,
RouterProvider,
createHashHistory,
} from '@tanstack/react-router'
// import { TanStackRouterDevtools } from '@tanstack/router-devtools'
import { memo, useEffect, useRef } from 'react'
@ -301,8 +302,11 @@ export const RootProvider = memo((props: { context: Partial<IRootContext> }) =>
generateDynamicRoutes(menuData ?? [], layoutAuthRoute)
const hashHistory = createHashHistory()
const router = createRouter({
routeTree,
history: hashHistory,
context: { queryClient, menuData: [] },
defaultPreload: 'intent',
defaultPendingComponent: () => <Loading loading={true} delay={300}/>

Loading…
Cancel
Save