mirror of
https://github.com/zuiidea/antd-admin.git
synced 2026-10-19 16:14:37 +00:00
✏️ Fixing typos, exlude => exclude.
This commit is contained in:
+1
-1
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
@@ -10,7 +10,7 @@ module.exports = {
|
||||
{
|
||||
name: 'primary',
|
||||
include: [/.*/],
|
||||
exlude: [/(\/(en|zh))*\/login/],
|
||||
exclude: [/(\/(en|zh))*\/login/],
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
+5
-5
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user