Browse Source

flexible Card title wrapper (#3416)

pull/3427/head
xiaofan2406 8 years ago
committed by 偏右
parent
commit
10afe1372f
  1. 19
      components/card/index.tsx

19
components/card/index.tsx

@ -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}>

Loading…
Cancel
Save