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(navbar): title区域自适应宽度 #1891

Merged
merged 8 commits into from
Jan 26, 2024
Merged

Conversation

irisSong
Copy link
Collaborator

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (20ae2cd) 76.21% compared to head (0dbe345) 76.25%.
Report is 6 commits behind head on next.

Files Patch % Lines
src/packages/navbar/navbar.tsx 86.48% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1891      +/-   ##
==========================================
+ Coverage   76.21%   76.25%   +0.03%     
==========================================
  Files         215      215              
  Lines        8700     8733      +33     
  Branches     2490     2500      +10     
==========================================
+ Hits         6631     6659      +28     
- Misses       1873     1878       +5     
  Partials      196      196              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

className={`${classPrefix}-title`}
style={{
minWidth: contentRealWidth,
maxWidth: contentRealWidth,
Copy link
Collaborator

Choose a reason for hiding this comment

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

值都是同一个,为什么要分别设置 min、max,只设置 width 会有异常吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

值都是同一个,为什么要分别设置 min、max,只设置 width 会有异常吗?

设置 min 是为了限制样式中兜底的min,设置 max 是为了flex布局,right区域是定位不占位问题

title居左布局,title宽度改成样式实现,已提交

} else if (leftRectWidth && rightRectWidth) {
centerWidth =
wrapperWidth -
(leftRectWidth > rightRectWidth
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里的算法是考虑到什么情况了?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这里的算法是考虑到什么情况了?

left、right内容区域不同宽, title区域居中

@@ -39,6 +39,9 @@
font-size: $navbar-title-font-size;
font-weight: $navbar-title-font-weight;
color: $navbar-title-font-color;
& > div {
Copy link
Collaborator

Choose a reason for hiding this comment

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

如果是 rn 或者鸿蒙系统,可能无法匹配div

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

如果是 rn 或者鸿蒙系统,可能无法匹配div
改为demo中实现

@oasis-cloud oasis-cloud merged commit f70d860 into jdf2e:next Jan 26, 2024
5 checks passed
@irisSong irisSong deleted the next-navbar branch March 25, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants