-
-
Notifications
You must be signed in to change notification settings - Fork 619
Use component-classes for className manipulation #120
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
Conversation
5bf2e8a
to
49e74f5
Compare
49e74f5
to
828ccee
Compare
src/Table.jsx
Outdated
if (this.tableNode) { | ||
const { prefixCls } = this.props; | ||
classes(this.tableNode).remove(new RegExp(`^${prefixCls}-scroll-position-.+$`)); | ||
classes(this.tableNode).add(`${prefixCls}-scroll-position-${position}`); |
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.
👌
This patch improve table horizontal scroll performance, #4631
className += ` ${prefixCls}-fixed-header`; | ||
} | ||
className += ` ${prefixCls}-scroll-position-${this.state.scrollPosition}`; | ||
className += ` ${prefixCls}-scroll-position-${this.scrollPosition}`; |
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.
一开始会是 undefined 。
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.
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.
应该说不写的话,一 render
设置的 class 就没了。
828ccee
to
f92e86c
Compare
This patch improves table horizontal scroll performance, ant-design/ant-design#4631