✏️ Fixing typos, exlude => exclude.

This commit is contained in:
zuiidea
2019-04-18 09:58:16 +08:00
parent de8b6c972d
commit bef5b26509
5 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ Take a new layout named `secondary` as an example to make the route starting wit
           {
               name: 'primary',
               include: [/.*/],
               exlude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
               exclude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
           },
           {
               name: 'secondary',
+3 -3
View File
@@ -44,7 +44,7 @@
{
name: 'primary',
include: [/.*/],
exlude: [/(\/(en|zh))*\/login/],
exclude: [/(\/(en|zh))*\/login/],
},
],
```
@@ -55,9 +55,9 @@
- `include` - 指定使用该布局的路由规则列表,规则可为正则表达式或者字符串;
- `exlude` - 指定不使用该布局的路由规则列表,规则可为正则表达式或者字符串。
- `exclude` - 指定不使用该布局的路由规则列表,规则可为正则表达式或者字符串。
> 注意:`exlude` 优先级高于 `include`,前面的布局优先级高于后面的布局。开发过程中可能需要结合`src/layouts`目录下的布局使用,具体方法可查看 [使用布局](./layout.md)。
> 注意:`exclude` 优先级高于 `include`,前面的布局优先级高于后面的布局。开发过程中可能需要结合`src/layouts`目录下的布局使用,具体方法可查看 [使用布局](./layout.md)。
## i18n
+1 -1
View File
@@ -11,7 +11,7 @@
{
name: 'primary',
include: [/.*/],
exlude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
exclude: [/(\/(en|zh))*\/login/, /(\/(en|zh))*\/seconday\/(.*)/],
},
{
name: 'secondary',
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = {
{
name: 'primary',
include: [/.*/],
exlude: [/(\/(en|zh))*\/login/],
exclude: [/(\/(en|zh))*\/login/],
},
],
+5 -5
View File
@@ -211,7 +211,7 @@ export function queryLayout(layouts, pathname) {
for (const item of layouts) {
let include = false
let exlude = false
let exclude = false
if (item.include) {
for (const regepx of item.include) {
if (isMatch(regepx)) {
@@ -221,16 +221,16 @@ export function queryLayout(layouts, pathname) {
}
}
if (include && item.exlude) {
for (const regepx of item.exlude) {
if (include && item.exclude) {
for (const regepx of item.exclude) {
if (isMatch(regepx)) {
exlude = true
exclude = true
break
}
}
}
if (include && !exlude) {
if (include && !exclude) {
result = item.name
break
}