Merge pull request #1080 from karlhorky/patch-1

Fix typo
This commit is contained in:
Baorong Li
2020-12-15 08:24:21 -06:00
committed by GitHub
2 changed files with 14 additions and 14 deletions
+7 -7
View File
@@ -2,7 +2,7 @@
## Add a new layout
Take a new layout named `secondary` as an example to make the route starting with `seconday` use this layout.
Take a new layout named `secondary` as an example to make the route starting with `secondary` use this layout.
1. Add related configuration in `src/utils/config.js`. For details, please refer to [layouts](/configuration?id=layouts).
@@ -11,11 +11,11 @@ Take a new layout named `secondary` as an example to make the route starting wit
           {
               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\/(.*)/],
           },
   ],
```
@@ -40,21 +40,21 @@ Take a new layout named `secondary` as an example to make the route starting wit
   export default ({ children }) => {
     Return (
       <div>
         <h1>Seconday</h1>
         <h1>Secondary</h1>
         {children}
       </div>
     )
   }
```
4. Add a `seconday/index.js` file to the `src/pages/` directory.
4. Add a `secondary/index.js` file to the `src/pages/` directory.
```javascript
   import React from 'react'
   export default ({ children }) => {
     Return <div>Seconday page Content</div>
     Return <div>Secondary page Content</div>
   }
```
5. Finally, start the development mode `npm run start`, open [http://localhost:7000/seconday/](http://localhost:7000/seconday/) and you will see the page for the `seconday` layout.
5. Finally, start the development mode `npm run start`, open [http://localhost:7000/secondary/](http://localhost:7000/secondary/) and you will see the page for the `secondary` layout.
+7 -7
View File
@@ -2,7 +2,7 @@
## 新增布局
以新增名为 `secondary` 的布局为例,使以 `seconday` 开头的路由都使用该布局。
以新增名为 `secondary` 的布局为例,使以 `secondary` 开头的路由都使用该布局。
1. 在 `src/utils/config.js` 新增相关配置,参数详细请查看 [layouts](/zh-cn/configuration?id=layouts)。
@@ -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\/(.*)/],
},
],
```
@@ -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` 布局的页面。