| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import { useSlots as m, ref as S, computed as n, openBlock as s, createElementBlock as l, normalizeStyle as d, normalizeClass as _, createElementVNode as c, renderSlot as a, createTextVNode as g, toDisplayString as v, createCommentVNode as i, createVNode as k, withCtx as $ } from "vue";
- import { n as b } from "./index2.js";
- import { S as x } from "./index9.js";
- const z = { class: "s-panel-layout-title" }, N = {
- key: 0,
- class: "s-panel-layout-extra"
- }, w = { class: "s-panel-layout-content" }, B = {
- key: 1,
- class: "s-panel-layout-footer"
- }, P = /* @__PURE__ */ Object.assign({ name: "SPanelLayout" }, {
- __name: "SPanelLayout",
- props: {
- // 面板标题
- title: {
- type: String,
- default: ""
- },
- // 是否显示标题栏(传了 #extra 插槽时也会显示)
- showTitle: {
- type: Boolean,
- default: !0
- },
- // 面板高度:默认占满父容器,可传 '100vh' / 'calc(100vh - 60px)' / 具体像素值
- height: {
- type: [String, Number],
- default: "100%"
- },
- headerSticky: {
- type: Boolean,
- default: !1
- }
- },
- setup(r) {
- const e = r, o = m(), h = S(8), u = n(() => !!(e.title || o.title || o.extra || o.footer)), p = n(() => e.showTitle && !!(e.title || o.title || o.extra)), f = n(() => !u.value || e.height === null || e.height === void 0 || e.height === "" || e.height === "100%" ? null : {
- height: typeof e.height == "number" ? `${e.height}px` : e.height
- });
- return (t, V) => {
- const y = x;
- return s(), l("div", {
- class: _(["s-panel-layout", { "is-panel": u.value }]),
- style: d(f.value)
- }, [
- p.value ? (s(), l("div", {
- key: 0,
- class: "s-panel-layout-header",
- style: d({ position: e.headerSticky ? "sticky" : "" })
- }, [
- c("div", z, [
- a(t.$slots, "title", {}, () => [
- g(v(r.title), 1)
- ], !0)
- ]),
- t.$slots.extra ? (s(), l("div", N, [
- a(t.$slots, "extra", {}, void 0, !0)
- ])) : i("", !0)
- ], 4)) : i("", !0),
- c("div", w, [
- a(t.$slots, "default", {}, void 0, !0)
- ]),
- t.$slots.footer ? (s(), l("div", B, [
- k(y, { size: h.value }, {
- default: $(() => [
- a(t.$slots, "footer", {}, void 0, !0)
- ]),
- _: 3
- }, 8, ["size"])
- ])) : i("", !0)
- ], 6);
- };
- }
- }), E = /* @__PURE__ */ b(P, [["__scopeId", "data-v-ecb1bd03"]]);
- export {
- E as default
- };
|