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?: VNodeTypes; content?: 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} )} {content && ( {content} )} ); }; export default Cell;