flexible Card title wrapper (#3416)

This commit is contained in:
xiaofan2406 2016-10-14 17:41:21 +11:00 committed by 偏右
parent 98c15a5113
commit 10afe1372f

View File

@ -39,11 +39,20 @@ export default (props: CardProps) => {
);
}
const head = title ? (
<div className={`${prefixCls}-head`}>
<h3 className={`${prefixCls}-head-title`}>{title}</h3>
</div>
) : null;
let head;
if (!title) {
head = null;
} else {
head = typeof title === 'string' ? (
<div className={`${prefixCls}-head`}>
<h3 className={`${prefixCls}-head-title`}>{title}</h3>
</div>
) : (
<div className={`${prefixCls}-head`}>
<div className={`${prefixCls}-head-title`}>{title}</div>
</div>
);
}
return (
<div {...others} className={classString}>