UNPKG

song-ui-u

Version:

vue3 + js的PC前端组件库

60 lines (51 loc) 1.82 kB
import { useSlots, computed, openBlock, createElementBlock, normalizeClass, renderSlot } from 'vue'; import { useNamespace } from '../../../hook/use-namespace/index.mjs'; import 'song-ui-pro-icon'; import '../../../hook/use-zindex/index.mjs'; import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs'; const __default__ = { name: "x-container" }; const _sfc_main = /*#__PURE__*/Object.assign(__default__, { props: { direction: { type: String, default: "", }, }, setup(__props, { expose: __expose }) { __expose(); const ns = useNamespace("container"); // slots const slots = useSlots(); /** props */ const props = __props; const isVertical = computed(() => { if (props.direction === "vertical") { return true; } if (props.direction === "horizontal") { return false; } if (slots && slots.default) { const slotsNodes = slots.default(); const tag = slotsNodes.some((nodes) => ["x-header", "x-footer"].includes(nodes.type.name) ); return tag; } return false; }); const __returned__ = { ns, slots, props, isVertical, computed, useSlots, get useNamespace() { return useNamespace } }; Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true }); return __returned__ } }); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return (openBlock(), createElementBlock("section", { class: normalizeClass([$setup.ns.b(), $setup.ns.is('vertical', $setup.isVertical)]) }, [ renderSlot(_ctx.$slots, "default") ], 2 /* CLASS */)) } var Container = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render],['__file',"E:\\code\\my-code\\song-ui-ultra\\packages\\components\\container\\src\\container.vue"]]); export { Container as default }; //# sourceMappingURL=container.vue.mjs.map