Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
fz6m authored Feb 26, 2024
1 parent d720a38 commit a9cbdb9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions docs/docs/docs/guides/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,17 @@ export default withAuth(TheOldPage)

* Type: `boolean`

控制该路由是否使用 Layout 包裹。
通过配置 `layout: false` 可以单独关闭某一个路由的全局布局:

```js
// .umirc.ts

export default {
routes: [
{ path: '/home', component: '@/pages/Home/index' },
{ path: '/list', component: '@/pages/List/index', layout: false },
// 取消 login 页面的全局布局,从而自行实现整个页面
{ path: '/login', component: '@/pages/Login', layout: false },
],
}
```

在上面的路由配置中,`/home` 路由会默认被 `Layout` 包裹,而 `/list` 则不会。

## 约定式路由

除配置式路由外,Umi 也支持约定式路由。约定式路由也叫文件路由,就是不需要手写配置,文件系统即路由,通过目录和文件及其命名分析出路由配置。
Expand Down

0 comments on commit a9cbdb9

Please sign in to comment.