-
Notifications
You must be signed in to change notification settings - Fork 269
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
Conversation
Codecov ReportAttention:
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. |
src/packages/navbar/navbar.tsx
Outdated
className={`${classPrefix}-title`} | ||
style={{ | ||
minWidth: contentRealWidth, | ||
maxWidth: contentRealWidth, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
值都是同一个,为什么要分别设置 min、max,只设置 width 会有异常吗?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的算法是考虑到什么情况了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的算法是考虑到什么情况了?
left、right内容区域不同宽, title区域居中
src/packages/navbar/navbar.scss
Outdated
@@ -39,6 +39,9 @@ | |||
font-size: $navbar-title-font-size; | |||
font-weight: $navbar-title-font-weight; | |||
color: $navbar-title-font-color; | |||
& > div { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是 rn 或者鸿蒙系统,可能无法匹配div
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是 rn 或者鸿蒙系统,可能无法匹配div
改为demo中实现
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单