You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB

3 months ago
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  5. var index = require('../../../hooks/use-namespace/index.js');
  6. const __default__ = vue.defineComponent({
  7. name: "ElContainer"
  8. });
  9. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  10. ...__default__,
  11. props: {
  12. direction: {
  13. type: String
  14. }
  15. },
  16. setup(__props) {
  17. const props = __props;
  18. const slots = vue.useSlots();
  19. const ns = index.useNamespace("container");
  20. const isVertical = vue.computed(() => {
  21. if (props.direction === "vertical") {
  22. return true;
  23. } else if (props.direction === "horizontal") {
  24. return false;
  25. }
  26. if (slots && slots.default) {
  27. const vNodes = slots.default();
  28. return vNodes.some((vNode) => {
  29. const tag = vNode.type.name;
  30. return tag === "ElHeader" || tag === "ElFooter";
  31. });
  32. } else {
  33. return false;
  34. }
  35. });
  36. return (_ctx, _cache) => {
  37. return vue.openBlock(), vue.createElementBlock("section", {
  38. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).is("vertical", vue.unref(isVertical))])
  39. }, [
  40. vue.renderSlot(_ctx.$slots, "default")
  41. ], 2);
  42. };
  43. }
  44. });
  45. var Container = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "container.vue"]]);
  46. exports["default"] = Container;
  47. //# sourceMappingURL=container.js.map