import { VNodeTypes, HTMLAttributes, FunctionalComponent } from 'vue';
function notEmpty(val: any) {
return val !== undefined && val !== null;
}
interface CellProps extends HTMLAttributes {
itemPrefixCls: string;
span: number;
component: string;
bordered?: boolean;
label?: VNodeTypes;
content?: VNodeTypes;
colon?: boolean;
}
const Cell: FunctionalComponent = props => {
const { itemPrefixCls, component, span, bordered, label, content, colon } = props;
const Component = component as any;
if (bordered) {
return (
{notEmpty(label) ? label : content}
);
}
return (
{label && (
{label}
)}
{content && {content}}
);
};
export default Cell;