@coderlt/form-designer
Version:
基于vue3的设计器,可视化开发页面表单
82 lines (81 loc) • 2.19 kB
JavaScript
import { defineComponent as m, inject as h, computed as r, openBlock as g, createBlock as $, resolveDynamicComponent as N, normalizeClass as _, unref as p, normalizeStyle as x, withCtx as j, renderSlot as C } from "vue";
import { a6 as v, a7 as o, bt as u, aa as O, aL as f, bx as E, ah as k, aG as w } from "./index-74b7090f.js";
import { r as S } from "./constants-669e1a5f.js";
const B = v({
tag: {
type: String,
default: "div"
},
span: {
type: Number,
default: 24
},
offset: {
type: Number,
default: 0
},
pull: {
type: Number,
default: 0
},
push: {
type: Number,
default: 0
},
xs: {
type: o([Number, Object]),
default: () => u({})
},
sm: {
type: o([Number, Object]),
default: () => u({})
},
md: {
type: o([Number, Object]),
default: () => u({})
},
lg: {
type: o([Number, Object]),
default: () => u({})
},
xl: {
type: o([Number, Object]),
default: () => u({})
}
}), K = m({
name: "ElCol"
}), L = /* @__PURE__ */ m({
...K,
props: B,
setup(b) {
const s = b, { gutter: n } = h(S, { gutter: r(() => 0) }), a = O("col"), d = r(() => {
const e = {};
return n.value && (e.paddingLeft = e.paddingRight = `${n.value / 2}px`), e;
}), i = r(() => {
const e = [];
return ["span", "offset", "pull", "push"].forEach((t) => {
const l = s[t];
f(l) && (t === "span" ? e.push(a.b(`${s[t]}`)) : l > 0 && e.push(a.b(`${t}-${s[t]}`)));
}), ["xs", "sm", "md", "lg", "xl"].forEach((t) => {
f(s[t]) ? e.push(a.b(`${t}-${s[t]}`)) : E(s[t]) && Object.entries(s[t]).forEach(([l, c]) => {
e.push(l !== "span" ? a.b(`${t}-${l}-${c}`) : a.b(`${t}-${c}`));
});
}), n.value && e.push(a.is("guttered")), [a.b(), e];
});
return (e, y) => (g(), $(N(e.tag), {
class: _(p(i)),
style: x(p(d))
}, {
default: j(() => [
C(e.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var P = /* @__PURE__ */ k(L, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/col/src/col.vue"]]);
const T = w(P);
export {
T as E,
B as c
};