Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
6e56098a
Commit
6e56098a
authored
Jan 26, 2018
by
unrealsmart
Committed by
ddcat1115
Jan 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
breadcrumb separator custom (#811)
* Slider breakpoint: md => lg * breadcrumb separator custom
parent
fd031535
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
src/components/PageHeader/index.js
src/components/PageHeader/index.js
+12
-5
No files found.
src/components/PageHeader/index.js
View file @
6e56098a
...
@@ -43,10 +43,13 @@ export default class PageHeader extends PureComponent {
...
@@ -43,10 +43,13 @@ export default class PageHeader extends PureComponent {
// Generated according to props
// Generated according to props
conversionFromProps
=
()
=>
{
conversionFromProps
=
()
=>
{
const
{
const
{
breadcrumbList
,
linkElement
=
'
a
'
,
breadcrumbList
,
breadcrumbSeparator
,
linkElement
=
'
a
'
,
}
=
this
.
props
;
}
=
this
.
props
;
return
(
return
(
<
Breadcrumb
className
=
{
styles
.
breadcrumb
}
>
<
Breadcrumb
className
=
{
styles
.
breadcrumb
}
separator
=
{
breadcrumbSeparator
}
>
{
breadcrumbList
.
map
(
item
=>
(
{
breadcrumbList
.
map
(
item
=>
(
<
Breadcrumb
.
Item
key
=
{
item
.
title
}
>
<
Breadcrumb
.
Item
key
=
{
item
.
title
}
>
{
item
.
href
?
(
createElement
(
linkElement
,
{
{
item
.
href
?
(
createElement
(
linkElement
,
{
...
@@ -58,7 +61,7 @@ export default class PageHeader extends PureComponent {
...
@@ -58,7 +61,7 @@ export default class PageHeader extends PureComponent {
);
);
}
}
conversionFromLocation
=
(
routerLocation
,
breadcrumbNameMap
)
=>
{
conversionFromLocation
=
(
routerLocation
,
breadcrumbNameMap
)
=>
{
const
{
linkElement
=
'
a
'
}
=
this
.
props
;
const
{
breadcrumbSeparator
,
linkElement
=
'
a
'
}
=
this
.
props
;
// Convert the path to an array
// Convert the path to an array
const
pathSnippets
=
routerLocation
.
pathname
.
split
(
'
/
'
).
filter
(
i
=>
i
);
const
pathSnippets
=
routerLocation
.
pathname
.
split
(
'
/
'
).
filter
(
i
=>
i
);
// Loop data mosaic routing
// Loop data mosaic routing
...
@@ -84,7 +87,10 @@ export default class PageHeader extends PureComponent {
...
@@ -84,7 +87,10 @@ export default class PageHeader extends PureComponent {
<
/Breadcrumb.Item
>
<
/Breadcrumb.Item
>
);
);
return
(
return
(
<
Breadcrumb
className
=
{
styles
.
breadcrumb
}
>
<
Breadcrumb
className
=
{
styles
.
breadcrumb
}
separator
=
{
breadcrumbSeparator
}
>
{
extraBreadcrumbItems
}
{
extraBreadcrumbItems
}
<
/Breadcrumb
>
<
/Breadcrumb
>
);
);
...
@@ -94,7 +100,7 @@ export default class PageHeader extends PureComponent {
...
@@ -94,7 +100,7 @@ export default class PageHeader extends PureComponent {
* Convert parameters into breadcrumbs
* Convert parameters into breadcrumbs
*/
*/
conversionBreadcrumbList
=
()
=>
{
conversionBreadcrumbList
=
()
=>
{
const
{
breadcrumbList
}
=
this
.
props
;
const
{
breadcrumbList
,
breadcrumbSeparator
}
=
this
.
props
;
const
{
routes
,
params
,
routerLocation
,
breadcrumbNameMap
}
=
this
.
getBreadcrumbProps
();
const
{
routes
,
params
,
routerLocation
,
breadcrumbNameMap
}
=
this
.
getBreadcrumbProps
();
if
(
breadcrumbList
&&
breadcrumbList
.
length
)
{
if
(
breadcrumbList
&&
breadcrumbList
.
length
)
{
return
this
.
conversionFromProps
();
return
this
.
conversionFromProps
();
...
@@ -108,6 +114,7 @@ export default class PageHeader extends PureComponent {
...
@@ -108,6 +114,7 @@ export default class PageHeader extends PureComponent {
routes
=
{
routes
.
filter
(
route
=>
route
.
breadcrumbName
)}
routes
=
{
routes
.
filter
(
route
=>
route
.
breadcrumbName
)}
params
=
{
params
}
params
=
{
params
}
itemRender
=
{
this
.
itemRender
}
itemRender
=
{
this
.
itemRender
}
separator
=
{
breadcrumbSeparator
}
/
>
/
>
);
);
}
}
...
...
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