index.js 937 B

12345678910111213141516171819202122232425262728293031323334
  1. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  2. // Utils
  3. import { createNamespace } from '../utils';
  4. import { inherit } from '../utils/functional';
  5. import { BORDER_TOP_BOTTOM } from '../utils/constant'; // Types
  6. var _createNamespace = createNamespace('cell-group'),
  7. createComponent = _createNamespace[0],
  8. bem = _createNamespace[1];
  9. function CellGroup(h, props, slots, ctx) {
  10. var _ref;
  11. var Group = h("div", _mergeJSXProps([{
  12. "class": [bem(), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = props.border, _ref)]
  13. }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default()]);
  14. if (props.title || slots.title) {
  15. return h("div", [h("div", {
  16. "class": bem('title')
  17. }, [slots.title ? slots.title() : props.title]), Group]);
  18. }
  19. return Group;
  20. }
  21. CellGroup.props = {
  22. title: String,
  23. border: {
  24. type: Boolean,
  25. default: true
  26. }
  27. };
  28. export default createComponent(CellGroup);