Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
f65bed72
Commit
f65bed72
authored
Oct 28, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: restore the breadcrumb display icon function
parent
a2c413a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
LayoutBreadcrumb.tsx
src/layouts/default/LayoutBreadcrumb.tsx
+23
-2
No files found.
CHANGELOG.zh_CN.md
View file @
f65bed72
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
-
新增
`pwa`
功能,可在
`.env.production`
开启
-
新增
`pwa`
功能,可在
`.env.production`
开启
-
Button 组件扩展
`preIcon`
和
`postIcon`
属性用于在文本前后添加图标
-
Button 组件扩展
`preIcon`
和
`postIcon`
属性用于在文本前后添加图标
-
恢复面包屑显示图标功能
### 🎫 Chores
### 🎫 Chores
...
...
src/layouts/default/LayoutBreadcrumb.tsx
View file @
f65bed72
import
type
{
AppRouteRecordRaw
}
from
'
/@/router/types
'
;
import
type
{
AppRouteRecordRaw
}
from
'
/@/router/types
'
;
import
type
{
RouteLocationMatched
}
from
'
vue-router
'
;
import
type
{
RouteLocationMatched
}
from
'
vue-router
'
;
import
type
{
PropType
}
from
'
vue
'
;
import
{
defineComponent
,
TransitionGroup
,
unref
,
watch
,
ref
}
from
'
vue
'
;
import
{
defineComponent
,
TransitionGroup
,
unref
,
watch
,
ref
}
from
'
vue
'
;
import
Breadcrumb
from
'
/@/components/Breadcrumb/Breadcrumb.vue
'
;
import
Breadcrumb
from
'
/@/components/Breadcrumb/Breadcrumb.vue
'
;
...
@@ -10,10 +11,17 @@ import { PageEnum } from '/@/enums/pageEnum';
...
@@ -10,10 +11,17 @@ import { PageEnum } from '/@/enums/pageEnum';
import
{
isBoolean
}
from
'
/@/utils/is
'
;
import
{
isBoolean
}
from
'
/@/utils/is
'
;
import
{
compile
}
from
'
path-to-regexp
'
;
import
{
compile
}
from
'
path-to-regexp
'
;
import
Icon
from
'
/@/components/Icon
'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
BasicBreadcrumb
'
,
name
:
'
BasicBreadcrumb
'
,
setup
()
{
props
:
{
showIcon
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
},
setup
(
props
)
{
const
itemList
=
ref
<
AppRouteRecordRaw
[]
>
([]);
const
itemList
=
ref
<
AppRouteRecordRaw
[]
>
([]);
const
{
currentRoute
,
push
}
=
useRouter
();
const
{
currentRoute
,
push
}
=
useRouter
();
...
@@ -82,7 +90,20 @@ export default defineComponent({
...
@@ -82,7 +90,20 @@ export default defineComponent({
isLink=
{
isLink
}
isLink=
{
isLink
}
onClick=
{
handleItemClick
.
bind
(
null
,
item
)
}
onClick=
{
handleItemClick
.
bind
(
null
,
item
)
}
>
>
{
()
=>
item
.
meta
.
title
}
{
()
=>
(
<>
{
props
.
showIcon
&&
item
.
meta
.
icon
&&
item
.
meta
.
icon
.
trim
()
!==
''
&&
(
<
Icon
icon=
{
item
.
meta
.
icon
}
class=
"icon mr-1 "
style=
{
{
marginBottom
:
'
2px
'
,
}
}
/>
)
}
{
item
.
meta
.
title
}
</>
)
}
</
BreadcrumbItem
>
</
BreadcrumbItem
>
);
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment