row2.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var constants = require('./constants.js');
  5. var row = require('./row.js');
  6. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  7. var index = require('../../../hooks/use-namespace/index.js');
  8. const __default__ = vue.defineComponent({
  9. name: "ElRow"
  10. });
  11. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  12. ...__default__,
  13. props: row.rowProps,
  14. setup(__props) {
  15. const props = __props;
  16. const ns = index.useNamespace("row");
  17. const gutter = vue.computed(() => props.gutter);
  18. vue.provide(constants.rowContextKey, {
  19. gutter
  20. });
  21. const style = vue.computed(() => {
  22. const styles = {};
  23. if (!props.gutter) {
  24. return styles;
  25. }
  26. styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
  27. return styles;
  28. });
  29. const rowKls = vue.computed(() => [
  30. ns.b(),
  31. ns.is(`justify-${props.justify}`, props.justify !== "start"),
  32. ns.is(`align-${props.align}`, !!props.align)
  33. ]);
  34. return (_ctx, _cache) => {
  35. return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
  36. class: vue.normalizeClass(vue.unref(rowKls)),
  37. style: vue.normalizeStyle(vue.unref(style))
  38. }, {
  39. default: vue.withCtx(() => [
  40. vue.renderSlot(_ctx.$slots, "default")
  41. ]),
  42. _: 3
  43. }, 8, ["class", "style"]);
  44. };
  45. }
  46. });
  47. var Row = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "row.vue"]]);
  48. exports["default"] = Row;
  49. //# sourceMappingURL=row2.js.map