UNPKG

qt-public-ui

Version:

新设计规范下业务组件库

28 lines 854 B
/* eslint-disable react/no-array-index-key */ import React from 'react'; import { Row, Col } from 'antd'; import './style'; var CardRow = function CardRow(props) { var span = props.span, children = props.children; var length = Array.isArray(children) ? children.length : 1; var spans = span ? span.split(':') : new Array(length).fill(24 / length); if (!children) return null; return /*#__PURE__*/React.createElement(Row, { className: "umui-page-card-row", gutter: 16 }, Array.isArray(children) ? children.map(function (child, i) { return /*#__PURE__*/React.createElement(Col, { key: i, span: spans[i] }, child); }) : /*#__PURE__*/React.createElement(Col, { span: 24, key: "only_child" }, children)); }; CardRow.displayName = 'CardRow'; CardRow.defaultProps = { span: '' }; export default CardRow;