-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
column support align attr #137
Conversation
之前列位置只能通过className去自己实现。 那么我的想法是通过参数配置,align。。align加了之后,方式有两种: 1、自己实现class 这里为了偷懒,感觉style更方便一些 |
这个算是 feature 了,麻烦提交到 branch 然后需要更新 API 文档并修复CI,谢谢。 |
const cell = { | ||
key: column.key, | ||
className: column.className || '', | ||
style: styleProp, |
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.
api好像没有提供,不过我觉得如果开放这个api,直接在配置里面这样写:
column: [{
styleProp: {textAlign: "center"}
}]
也是可以的,但感觉有些麻烦。。
不过开放这个API之后,我上面的写法确实会有问题,所以要么是通过叠加class,即内部规定三个class,让其定位位置吧?
的确加className就行
|
除非没有其他的解决方案,不然不认可特定场景专用的 API。 这种场景可以用 columns[n].className 解决,所以就不新增这个 feature 了。 |
I think it is useful, className is advanced usage, espacially for non front-end developer. |
@@ -225,9 +225,11 @@ export default class Table extends React.Component { | |||
rows.push([]); | |||
} | |||
} | |||
const styleProp = column.align ? { textAlign: column.align } : null; |
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.
null => undefined
ci 挂了。
ant-design/ant-design#2465