UNPKG

sci-pro

Version:
31 lines (30 loc) 1.1 kB
import { defineComponent as p, ref as g, onMounted as v, getCurrentInstance as _, computed as h, inject as y, openBlock as C, createElementBlock as x, normalizeStyle as S, renderSlot as k } from "vue"; import "./style/index.css"; const B = p({ name: "sci-col" }), z = /* @__PURE__ */ p({ ...B, props: { col: {} }, setup(d) { let o = g(!1); const f = d; v(() => { var l, n, r, c, s, a, u; const e = _(), t = (c = (r = (n = (l = e == null ? void 0 : e.parent) == null ? void 0 : l.vnode) == null ? void 0 : n.el) == null ? void 0 : r.children) == null ? void 0 : c.length; o.value = (e == null ? void 0 : e.vnode.el) === ((u = (a = (s = e == null ? void 0 : e.parent) == null ? void 0 : s.vnode) == null ? void 0 : a.el) == null ? void 0 : u.children[t - 1]); }); const i = h(() => ({ flex: f.col, marginRight: o.value ? "0px" : m.gap })), m = y("layoutConfig", {}); return (e, t) => (C(), x("div", { class: "sci-col", style: S(i.value) }, [ k(e.$slots, "default") ], 4)); } }); export { z as default };