提交 1d1d0bac 编写于 作者: A afc163

Add style for Form & FormItem

close #1290
上级 c10fbaed
......@@ -9,7 +9,7 @@ class Form extends React.Component {
}
render() {
const { prefixCls, className } = this.props;
const { prefixCls, className, style } = this.props;
const formClassName = classNames({
[`${prefixCls}-horizontal`]: this.props.horizontal,
[`${prefixCls}-inline`]: this.props.inline,
......@@ -17,7 +17,7 @@ class Form extends React.Component {
});
return (
<form {...this.props} className={formClassName}>
<form {...this.props} className={formClassName} style={style}>
{this.props.children}
</form>
);
......
......@@ -151,6 +151,7 @@ class FormItem extends React.Component {
renderFormItem(children) {
const props = this.props;
const prefixCls = props.prefixCls;
const style = props.style;
const itemClassName = {
[`${prefixCls}-item`]: true,
[`${prefixCls}-item-with-help`]: !!this.getHelpMsg(),
......@@ -158,7 +159,7 @@ class FormItem extends React.Component {
};
return (
<div className={classNames(itemClassName)}>
<div className={classNames(itemClassName)} style={style}>
{children}
</div>
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册