Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
啊嘞嘞EC
vue-vben-admin
提交
e0dc5cf2
V
vue-vben-admin
项目概览
啊嘞嘞EC
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e0dc5cf2
编写于
3月 07, 2021
作者:
V
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(breadcrumb): ensure that the single-level breadcrumbs jump correctly close #321
上级
d5d4c4b4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
16 deletion
+38
-16
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
src/layouts/default/header/components/Breadcrumb.vue
src/layouts/default/header/components/Breadcrumb.vue
+36
-15
src/main.ts
src/main.ts
+1
-1
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
e0dc5cf2
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
-
修复树组件 demo 示例样式错误
-
修复树组件 demo 示例样式错误
-
修复账号管理新增未清空旧数据
-
修复账号管理新增未清空旧数据
-
form 组件应允许 setFieldsValue 方法值为 null 或者 undefined
-
form 组件应允许 setFieldsValue 方法值为 null 或者 undefined
-
确保单级面包屑正确跳转
## 2.0.2 (2021-03-04)
## 2.0.2 (2021-03-04)
...
...
src/layouts/default/header/components/Breadcrumb.vue
浏览文件 @
e0dc5cf2
...
@@ -72,10 +72,25 @@
...
@@ -72,10 +72,25 @@
if
(
currentRoute
.
value
.
meta
?.
currentActiveMenu
)
{
if
(
currentRoute
.
value
.
meta
?.
currentActiveMenu
)
{
filterBreadcrumbList
.
push
((
currentRoute
.
value
as
unknown
)
as
RouteLocationMatched
);
filterBreadcrumbList
.
push
((
currentRoute
.
value
as
unknown
)
as
RouteLocationMatched
);
}
}
// routes.value = filterBreadcrumbList.length === 1 ? [] : filterBreadcrumbList;
routes
.
value
=
subRouteExtraction
(
filterBreadcrumbList
);
routes
.
value
=
filterBreadcrumbList
;
});
});
function
subRouteExtraction
(
routeList
:
RouteLocationMatched
[])
{
const
resultRoutes
:
RouteLocationMatched
[]
=
[];
routeList
.
forEach
((
route
)
=>
{
if
(
route
.
children
?.
length
===
1
)
{
const
subRoute
=
route
.
children
[
0
]
as
RouteLocationMatched
;
const
subRouteName
=
subRoute
.
name
as
string
;
const
routeName
=
route
.
name
;
if
(
subRouteName
&&
`
${
subRouteName
}
Parent`
===
routeName
)
{
route
=
subRoute
;
}
}
resultRoutes
.
push
(
route
);
});
return
resultRoutes
;
}
function
filterItem
(
list
:
RouteLocationMatched
[])
{
function
filterItem
(
list
:
RouteLocationMatched
[])
{
let
resultList
=
filter
(
list
,
(
item
)
=>
{
let
resultList
=
filter
(
list
,
(
item
)
=>
{
const
{
meta
}
=
item
;
const
{
meta
}
=
item
;
...
@@ -83,15 +98,14 @@
...
@@ -83,15 +98,14 @@
if
(
!
meta
)
{
if
(
!
meta
)
{
return
false
;
return
false
;
}
}
const
{
title
,
hideBreadcrumb
,
hideMenu
}
=
meta
;
const
{
title
,
hideBreadcrumb
,
hideMenu
}
=
meta
;
if
(
!
title
||
hideBreadcrumb
||
hideMenu
)
{
if
(
!
title
||
hideBreadcrumb
||
hideMenu
)
{
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}).
filter
((
item
)
=>
!
item
.
meta
?.
hideBreadcrumb
||
!
item
.
meta
?.
hideMenu
);
}).
filter
((
item
)
=>
!
item
.
meta
?.
hideBreadcrumb
||
!
item
.
meta
?.
hideMenu
);
// resultList = resultList.filter((item) => item.path !== PageEnum.BASE_HOME);
return
resultList
;
return
resultList
;
}
}
...
@@ -101,7 +115,8 @@
...
@@ -101,7 +115,8 @@
children
,
children
,
redirect
,
redirect
,
meta
,
meta
,
// components
// components
}
=
route
;
}
=
route
;
// const isParent =
// const isParent =
...
@@ -123,23 +138,29 @@
...
@@ -123,23 +138,29 @@
if
(
redirect
&&
isString
(
redirect
))
{
if
(
redirect
&&
isString
(
redirect
))
{
go
(
redirect
);
go
(
redirect
);
}
else
{
}
else
{
const
ps
=
paths
.
slice
(
1
);
let
goPath
=
''
;
const
lastPath
=
ps
.
pop
()
||
''
;
if
(
paths
.
length
===
1
)
{
const
parentPath
=
ps
.
pop
()
||
''
;
goPath
=
paths
[
0
];
let
path
=
`
${
parentPath
}
/
${
lastPath
}
`
;
}
else
{
path
=
/^
\/
/
.
test
(
path
)
?
path
:
`/
${
path
}
`
;
const
ps
=
paths
.
slice
(
1
);
go
(
path
);
const
lastPath
=
ps
.
pop
()
||
''
;
const
parentPath
=
ps
.
pop
()
||
''
;
goPath
=
`
${
parentPath
}
/
${
lastPath
}
`
;
}
goPath
=
/^
\/
/
.
test
(
goPath
)
?
goPath
:
`/
${
goPath
}
`
;
go
(
goPath
);
}
}
}
}
function
hasRedirect
(
routes
:
RouteLocationMatched
[],
route
:
RouteLocationMatched
)
{
function
hasRedirect
(
routes
:
RouteLocationMatched
[],
route
:
RouteLocationMatched
)
{
if
(
route
?.
meta
?.
isLink
)
{
return
true
;
}
if
(
routes
.
indexOf
(
route
)
===
routes
.
length
-
1
)
{
if
(
routes
.
indexOf
(
route
)
===
routes
.
length
-
1
)
{
return
false
;
return
false
;
}
}
// if (route?.meta?.isLink) {
// return true;
// }
return
true
;
return
true
;
}
}
...
...
src/main.ts
浏览文件 @
e0dc5cf2
...
@@ -51,7 +51,7 @@ import { isDevMode } from '/@/utils/env';
...
@@ -51,7 +51,7 @@ import { isDevMode } from '/@/utils/env';
// The development environment takes effect
// The development environment takes effect
if
(
isDevMode
())
{
if
(
isDevMode
())
{
app
.
config
.
performance
=
true
;
//
app.config.performance = true;
window
.
__APP__
=
app
;
window
.
__APP__
=
app
;
}
}
})();
})();
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录