UNPKG

element-plus

Version:

A Component Library for Vue 3

49 lines (46 loc) 1.47 kB
import { rowProps } from './row.mjs'; import { defineComponent, computed, provide, createBlock, openBlock, resolveDynamicComponent, normalizeStyle, normalizeClass, withCtx, renderSlot } from 'vue'; import { rowContextKey } from './constants.mjs'; import { useNamespace } from '../../../hooks/use-namespace/index.mjs'; var _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: "ElRow" }, __name: "row", props: rowProps, setup(__props) { const props = __props; const ns = useNamespace("row"); const gutter = computed(() => props.gutter); provide(rowContextKey, { gutter }); const style = computed(() => { const styles = {}; if (!props.gutter) { return styles; } styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`; return styles; }); const rowKls = computed(() => [ ns.b(), ns.is(`justify-${props.justify}`, props.justify !== "start"), ns.is(`align-${props.align}`, !!props.align) ]); return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(__props.tag), { class: normalizeClass(rowKls.value), style: normalizeStyle(style.value) }, { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 /* FORWARDED */ }, 8, ["class", "style"]); }; } }); export { _sfc_main as default }; //# sourceMappingURL=row.vue2.mjs.map