tyh-ui2
Version:
The next generation ui component library of tyh-ui is based on vue3 Version, fully embrace vue3.
34 lines (33 loc) • 1.01 kB
JavaScript
import { defineComponent as c, useSlots as u, computed as a, openBlock as d, createElementBlock as f, normalizeClass as p, unref as h, renderSlot as m } from "vue";
const y = { name: "TyhContainer" }, v = /* @__PURE__ */ c({
...y,
props: {
direction: {
type: String,
validator(t) {
return ["horizontal", "vertical", ""].includes(t);
}
}
},
setup(t) {
const n = t, { isClass: i } = l();
function l() {
const e = u(), r = a(() => n.direction === "vertical" ? !0 : n.direction === "horizontal" ? !1 : e && e.default ? e.default().some((o) => {
const s = o.type && o.type.name;
return s === "TyhHeader" || s === "TyhFooter";
}) : !1);
return { isClass: a(() => [
"tyh-container",
r.value ? "tyh-container-horizontal" : "tyh-container-vertical"
]) };
}
return (e, r) => (d(), f("section", {
class: p(h(i))
}, [
m(e.$slots, "default")
], 2));
}
});
export {
v as default
};