Skip to content

Commit

Permalink
docs: add layout param for routes.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nnmax authored Feb 26, 2024
1 parent 0c561ea commit d720a38
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/docs/docs/guides/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,23 @@ const TheOldPage = ()=>{
export default withAuth(TheOldPage)
```

### layout

* Type: `boolean`

控制该路由是否使用 Layout 包裹。

```js
export default {
routes: [
{ path: '/home', component: '@/pages/Home/index' },
{ path: '/list', component: '@/pages/List/index', layout: false },
],
}
```

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

## 约定式路由

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

0 comments on commit d720a38

Please sign in to comment.