Add style for Form & FormItem

close #1290
This commit is contained in:
afc163 2016-03-30 11:01:09 +08:00
parent c10fbaed6f
commit 1d1d0bac0d
2 changed files with 4 additions and 3 deletions

View File

@ -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>
);

View File

@ -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>
);