mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-29 03:48:26 +08:00
29 lines
810 B
JavaScript
29 lines
810 B
JavaScript
import React from 'react';
|
|
import rcUtil from 'rc-util';
|
|
|
|
const Col = React.createClass({
|
|
propTypes: {
|
|
span: React.PropTypes.string,
|
|
order: React.PropTypes.string,
|
|
offset: React.PropTypes.string,
|
|
push: React.PropTypes.string,
|
|
pull: React.PropTypes.string,
|
|
className: React.PropTypes.string,
|
|
children: React.PropTypes.node,
|
|
},
|
|
render() {
|
|
const {span, order, offset, push, pull, className, ...others} = this.props;
|
|
const classes = rcUtil.classSet({
|
|
['col-' + span]: span,
|
|
['col-order-' + order]: order,
|
|
['col-offset-' + offset]: offset,
|
|
['col-push-' + push]: push,
|
|
['col-pull-' + pull]: pull,
|
|
[className]: className,
|
|
});
|
|
return <div {...others} className={classes}>{ this.props.children }</div>;
|
|
},
|
|
});
|
|
|
|
export default Col;
|