teleport2.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. require('../../../hooks/index.js');
  5. var teleport = require('./teleport.js');
  6. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  7. var index = require('../../../hooks/use-namespace/index.js');
  8. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  9. __name: "teleport",
  10. props: teleport.teleportProps,
  11. setup(__props, { expose }) {
  12. const props = __props;
  13. const ns = index.useNamespace("teleport");
  14. const containerRef = vue.ref();
  15. const containerStyle = vue.computed(() => {
  16. return props.container === "body" ? [
  17. props.style,
  18. {
  19. position: "absolute",
  20. top: `0px`,
  21. left: `0px`,
  22. zIndex: props.zIndex
  23. }
  24. ] : {};
  25. });
  26. expose({
  27. containerRef
  28. });
  29. return (_ctx, _cache) => {
  30. return _ctx.container ? (vue.openBlock(), vue.createBlock(vue.Teleport, {
  31. key: 0,
  32. to: _ctx.container,
  33. disabled: _ctx.disabled
  34. }, [
  35. vue.createElementVNode("div", {
  36. ref_key: "containerRef",
  37. ref: containerRef,
  38. class: vue.normalizeClass(vue.unref(ns).b()),
  39. style: vue.normalizeStyle(vue.unref(containerStyle))
  40. }, [
  41. vue.renderSlot(_ctx.$slots, "default")
  42. ], 6)
  43. ], 8, ["to", "disabled"])) : vue.createCommentVNode("v-if", true);
  44. };
  45. }
  46. });
  47. var Teleport = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/teleport/src/teleport.vue"]]);
  48. exports["default"] = Teleport;
  49. //# sourceMappingURL=teleport2.js.map