You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
739 B
33 lines
739 B
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
class Form extends React.Component {
|
|
render() {
|
|
const prefixCls = this.props.prefixCls;
|
|
const formClassName = {
|
|
[`${prefixCls}-horizontal`]: this.props.horizontal,
|
|
[`${prefixCls}-inline`]: this.props.inline,
|
|
};
|
|
const classes = classNames(formClassName);
|
|
|
|
return (
|
|
<form {...this.props} className={classes}>
|
|
{this.props.children}
|
|
</form>
|
|
);
|
|
}
|
|
}
|
|
|
|
Form.propTypes = {
|
|
prefixCls: React.PropTypes.string,
|
|
horizontal: React.PropTypes.bool,
|
|
inline: React.PropTypes.bool,
|
|
children: React.PropTypes.any,
|
|
onSubmit: React.PropTypes.func,
|
|
};
|
|
|
|
Form.defaultProps = {
|
|
prefixCls: 'ant-form',
|
|
};
|
|
|
|
module.exports = Form;
|
|
|