Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PageHeader support breadcrumbRender props #28723

Merged
merged 6 commits into from
Jan 22, 2021
Merged

Conversation

chenshuai2144
Copy link
Contributor

@chenshuai2144 chenshuai2144 commented Jan 6, 2021

[English Template / 英文模板]

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

需要自定义 pageheader 的面包屑

📝 更新日志

语言 更新描述
🇺🇸 英文 PageHeader support breadcrumbRender props
🇨🇳 中文 PageHeader 支持 breadcrumbRender 属性。

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jan 6, 2021

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 6, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 87ad29c:

Sandbox Source
antd reproduction template Configuration

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2021

Size Change: +126 B (0%)

Total Size: 789 kB

Filename Size Change
./dist/antd-with-locales.min.js 312 kB +23 B (0%)
./dist/antd.compact.min.css 66.9 kB +18 B (0%)
./dist/antd.dark.min.css 68.2 kB +49 B (0%)
./dist/antd.min.css 66.9 kB +14 B (0%)
./dist/antd.min.js 274 kB +22 B (0%)

compressed-size-action

@yoyo837
Copy link
Contributor

yoyo837 commented Jan 6, 2021

缺文档

@codecov
Copy link

codecov bot commented Jan 21, 2021

Codecov Report

Merging #28723 (87ad29c) into master (31e8b51) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master    #28723   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          393       393           
  Lines         7450      7457    +7     
  Branches      2149      2151    +2     
=========================================
+ Hits          7450      7457    +7     
Impacted Files Coverage Δ
components/page-header/index.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31e8b51...87ad29c. Read the comment docs.

@chenshuai2144 chenshuai2144 merged commit 2d476f7 into master Jan 22, 2021
@chenshuai2144 chenshuai2144 deleted the feat/page-header branch January 22, 2021 14:13
@@ -20,6 +20,7 @@ PageHeader can be used to highlight the page topic, display important informatio
| avatar | Avatar next to the title bar | [AvatarProps](/components/avatar/) | - | |
| backIcon | Custom back icon, if false the back icon will not be displayed | ReactNode \| boolean | &lt;ArrowLeft /> | |
| breadcrumb | Breadcrumb configuration | [Breadcrumb](/components/breadcrumb/) | - | |
| breadcrumbRender | Customize the content of the breadcrumb area | (props,dom)=>ReactNode | - | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- (props,dom)=>ReactNode
+ (props, dom) => ReactNode

少空格。

@@ -16,7 +16,8 @@ export interface PageHeaderProps {
title?: React.ReactNode;
subTitle?: React.ReactNode;
style?: React.CSSProperties;
breadcrumb?: BreadcrumbProps;
breadcrumb?: BreadcrumbProps | JSX.Element;
breadcrumbRender?: (props: PageHeaderProps, defaultDom: React.ReactNode) => React.ReactNode;
Copy link
Member

@afc163 afc163 Jan 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breadcrumb 不能完全替代 breadcrumbRender 的话,breadcrumb={<div />} 也不需要支持了,感觉两者是重复的。之前我以为加强 breadcrumb 就不需要 breadcrumbRender 了。

afc163 added a commit that referenced this pull request Jan 23, 2021
afc163 added a commit that referenced this pull request Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants