-
-
Notifications
You must be signed in to change notification settings - Fork 622
Use Column width #1344
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
Use Column width #1344
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ export default function MeasureCell({ columnKey, onColumnResize, column }: Measu | |
| style={{ paddingTop: 0, paddingBottom: 0, borderTop: 0, borderBottom: 0, height: 0 }} | ||
| > | ||
| <div style={{ height: 0, overflow: 'hidden', fontWeight: 'bold' }}> | ||
| {column?.title || '\xa0'} | ||
| {('width' in column ? '' : column?.title) || '\xa0'} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这样修好像没效果。
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 就是如果传了 width,就不渲染 title 了,还用空占位
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 没效果,还是 width: auto 的问题,去掉就好了。之前
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 也可能吧,我调试的时候,宽度一直不生效,还以为确实有问题,所以才改的。其实是列太多,导致 width 200 本来就会被挤掉的吧 |
||
| </div> | ||
| </td> | ||
| </ResizeObserver> | ||
|
|
||
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.
The
columnprop is optional and can beundefined. Using theinoperator on anundefinedvalue will cause aTypeErrorat runtime. You should add a null check forcolumnbefore attempting to access its properties or use theinoperator.