Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky authored Dec 15, 2020
1 parent 5abad21 commit aedd2ec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/zh-cn/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 新增布局

以新增名为 `secondary` 的布局为例,使以 `seconday` 开头的路由都使用该布局。
以新增名为 `secondary` 的布局为例,使以 `secondary` 开头的路由都使用该布局。

1.`src/utils/config.js` 新增相关配置,参数详细请查看 [layouts](/zh-cn/configuration?id=layouts)

Expand All @@ -11,11 +11,11 @@
{
name: 'primary',
include: [/.*/],
exclude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
exclude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/secondary\/(.*)/],
},
{
name: 'secondary',
include: [/(\/(en|zh))*\/seconday\/(.*)/],
include: [/(\/(en|zh))*\/secondary\/(.*)/],
},
],
```
Expand All @@ -40,21 +40,21 @@
export default ({ children }) => {
return (
<div>
<h1>Seconday</h1>
<h1>Secondary</h1>
{children}
</div>
)
}
```

4.`src/pages/` 目录中新增 `seconday/index.js` 文件。
4.`src/pages/` 目录中新增 `secondary/index.js` 文件。

```javascript
import React from 'react'

export default ({ children }) => {
return <div>Seconday page Content</div>
return <div>Secondary page Content</div>
}
```

5. 最后,启动开发模式 `npm run start`,打开 [http://localhost:7000/seconday/](http://localhost:7000/seconday/),你将看到 `seconday` 布局的页面。
5. 最后,启动开发模式 `npm run start`,打开 [http://localhost:7000/secondary/](http://localhost:7000/secondary/),你将看到 `secondary` 布局的页面。

0 comments on commit aedd2ec

Please sign in to comment.