> For the complete documentation index, see [llms.txt](https://yaa.docs.speaks.life/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yaa.docs.speaks.life/he-xin-gong-neng/shu-ju-biao-ge/lu-you.md).

# 路由

在路径 `ui/src/router/*`中添加路由路径，并在对应的路径中生成文件。

## 示例

以 `user`为例。

因为所属数据为后台，在 `ui/src/router/components/other/admin/index.ts` 文件中修改如下：

```typoscript
const routeKeys = [
    'home',
    'admin',
    'admin-group',
    'admin-log',
    'user', // 添加 user ， 对应在 views/Admin/ 下新建 user/Index.vue 文件
    'menu',
];
```

### 事项一

如果你的页面及路由符合以下格式

* **url   => admin/template**
* **文件(Index.vue) => views/Admin/template/Index.vue**

🎉 你可以，直接在 `routeKeys` 中添加 `template` 即可

### 事项二

当你的文件不符合以上时，请在 `router/components/other/index.ts` 中添加完善路由信息。如下所示：

```typescript
const routes = [
    {
        path: '/test',
        name: 'Test',
        component: () => import('@/views/test/Index.vue'),
    },
]

export default routes
```

添加路由后并完善路由文件信息。
