Files
antd-admin/apps/docs/content/zh/building/router.mdx
zuiidea 0726321552 docs: add localized docs routes and language content
Migrate docs to language-prefixed app routes and split content into zh/en trees, including translated English navigation and pages.

Made-with: Cursor
2026-04-28 17:31:50 +08:00

17 lines
635 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 路由
description: TanStack Router 文件路由与布局
---
# 路由
模板使用 **[TanStack Router](https://tanstack.com/router)** **文件路由**(插件根据 `src/routes` 生成 **`routeTree.gen.ts`**)。
常见模式:
- **根布局**:`__root.tsx` 中包裹 `ConfigProvider`、Outlet 等。
- **认证布局**:如 `_auth.tsx`,与登录页路由分离。
- **鉴权**:在路由 `beforeLoad` 或组件内结合 **权限与 `/login` 跳转**(实现以模板代码为准)。
新增业务页时,在同目录追加路由文件并遵循现有目录约定;类型安全依赖生成的 route tree。