UNPKG

element-plus

Version:

A Component Library for Vue 3

53 lines (48 loc) 1.54 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); require('../../../hooks/index.js'); var teleport = require('./teleport.js'); var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js'); var index = require('../../../hooks/use-namespace/index.js'); const _sfc_main = vue.defineComponent({ props: teleport.elTeleportProps, setup(props) { const ns = index.useNamespace("teleport"); const containerRef = vue.ref(); const containerStyle = vue.computed(() => { return props.container === "body" ? [ props.style, { position: "absolute", top: `0px`, left: `0px`, zIndex: props.zIndex } ] : {}; }); return { ns, containerRef, containerStyle }; } }); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return _ctx.container ? (vue.openBlock(), vue.createBlock(vue.Teleport, { key: 0, to: _ctx.container, disabled: _ctx.disabled }, [ vue.createElementVNode("div", { ref: "containerRef", class: vue.normalizeClass(_ctx.ns.b()), style: vue.normalizeStyle(_ctx.containerStyle) }, [ vue.renderSlot(_ctx.$slots, "default") ], 6) ], 8, ["to", "disabled"])) : vue.createCommentVNode("v-if", true); } var Teleport = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]); exports["default"] = Teleport; //# sourceMappingURL=teleport2.js.map