index.js 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = void 0;
  4. var _utils = require("../utils");
  5. var _use = (0, _utils.use)('row'),
  6. sfc = _use[0],
  7. bem = _use[1];
  8. var _default = sfc({
  9. props: {
  10. type: String,
  11. align: String,
  12. justify: String,
  13. tag: {
  14. type: String,
  15. "default": 'div'
  16. },
  17. gutter: {
  18. type: [Number, String],
  19. "default": 0
  20. }
  21. },
  22. render: function render(h) {
  23. var _bem;
  24. var align = this.align,
  25. justify = this.justify;
  26. var flex = this.type === 'flex';
  27. var margin = "-" + Number(this.gutter) / 2 + "px";
  28. var style = this.gutter ? {
  29. marginLeft: margin,
  30. marginRight: margin
  31. } : {};
  32. return h(this.tag, {
  33. "style": style,
  34. "class": bem((_bem = {
  35. flex: flex
  36. }, _bem["align-" + align] = flex && align, _bem["justify-" + justify] = flex && justify, _bem))
  37. }, [this.slots()]);
  38. }
  39. });
  40. exports["default"] = _default;