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