| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- import { ref as n, watch as b, watchEffect as g, openBlock as S, createBlock as C, withCtx as a, createElementVNode as c, renderSlot as m, createVNode as s, createTextVNode as u, toDisplayString as f } from "vue";
- import { n as N, B as $ } from "./index2.js";
- import { _ as k } from "./index8.js";
- import { S as B } from "./index9.js";
- const D = { class: "s-drawer-body" }, x = { class: "s-drawer-footer" }, z = {
- __name: "SDrawer",
- props: {
- value: {
- type: Boolean,
- default: !1
- },
- title: {
- type: String,
- default: ""
- },
- mode: {
- type: String,
- default: "right"
- },
- width: {
- type: Number,
- default: 500
- },
- height: {
- type: Number,
- default: 378
- }
- },
- emits: ["update:value", "confirm"],
- setup(o, { emit: p }) {
- const l = p, t = o, i = n(t.value);
- b(
- () => t.value,
- (e) => {
- i.value = e;
- },
- { immediate: !0 }
- );
- const _ = n(t.mode), h = n(8);
- g(() => {
- const e = {
- left: "",
- right: "",
- top: "",
- bottom: ""
- };
- Object.keys(e).includes(t.mode) || (console.warn(`当前设置mode【${t.mode}】不在【${e}】中,已默认为【right】`), _.value = "right");
- });
- const r = () => {
- l("update:value", !1);
- }, v = () => {
- l("update:value", !1), l("confirm");
- };
- return (e, V) => {
- const d = $, w = B, y = k;
- return S(), C(y, {
- rootClassName: "s-drawer-wrap",
- title: o.title,
- placement: o.mode,
- width: o.width,
- visible: i.value,
- onClose: r,
- bodyStyle: {
- padding: 0,
- display: "flex",
- flexDirection: "column"
- }
- }, {
- default: a(() => [
- c("div", D, [
- m(e.$slots, "default", {}, void 0, !0)
- ]),
- c("div", x, [
- s(w, { size: h.value }, {
- default: a(() => [
- m(e.$slots, "footer", {}, () => [
- s(d, { onClick: r }, {
- default: a(() => [
- u(f(e.$l("取消")), 1)
- ]),
- _: 1
- }),
- s(d, {
- type: "primary",
- onClick: v
- }, {
- default: a(() => [
- u(f(e.$l("确定")), 1)
- ]),
- _: 1
- })
- ], !0)
- ]),
- _: 3
- }, 8, ["size"])
- ])
- ]),
- _: 3
- }, 8, ["title", "placement", "width", "visible"]);
- };
- }
- }, T = /* @__PURE__ */ N(z, [["__scopeId", "data-v-4114af9f"]]);
- export {
- T as default
- };
|