| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- import { ref as f, watch as b, watchEffect as g, openBlock as l, createBlock as r, withCtx as n, createElementVNode as c, renderSlot as m, createCommentVNode as s, createTextVNode as p, toDisplayString as h } from "vue";
- import { n as $, B as C } from "./index2.js";
- import { _ as k } from "./index7.js";
- const S = { class: "s-drawer-body" }, B = { class: "s-drawer-footer" }, N = {
- __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
- },
- footer: {
- type: Boolean,
- default: !1
- }
- },
- emits: ["update:value", "confirm"],
- setup(t, { emit: y }) {
- const a = y, o = t, d = f(o.value);
- b(
- () => o.value,
- (e) => {
- d.value = e;
- },
- { immediate: !0 }
- );
- const v = f(o.mode);
- g(() => {
- const e = {
- left: "",
- right: "",
- top: "",
- bottom: ""
- };
- Object.keys(e).includes(o.mode) || (console.warn(`当前设置mode【${o.mode}】不在【${e}】中,已默认为【right】`), v.value = "right");
- });
- const i = () => {
- a("update:value", !1);
- }, w = () => {
- a("update:value", !1), a("confirm");
- };
- return (e, D) => {
- const u = C, _ = k;
- return l(), r(_, {
- rootClassName: "s-drawer-wrap",
- title: t.title,
- placement: t.mode,
- width: t.width,
- visible: d.value,
- onClose: i,
- bodyStyle: {
- padding: 0,
- display: "flex",
- flexDirection: "column"
- }
- }, {
- default: n(() => [
- c("div", S, [
- m(e.$slots, "default", {}, void 0, !0)
- ]),
- c("div", B, [
- e.$slots.footer ? m(e.$slots, "footer", {}, void 0, !0, 0) : s("", !0),
- !e.$slots.footer && t.footer ? (l(), r(u, {
- key: 1,
- onClick: i
- }, {
- default: n(() => [
- p(h(e.$l("取消")), 1)
- ]),
- _: 1
- })) : s("", !0),
- !e.$slots.footer && t.footer ? (l(), r(u, {
- key: 2,
- type: "primary",
- onClick: w
- }, {
- default: n(() => [
- p(h(e.$l("确定")), 1)
- ]),
- _: 1
- })) : s("", !0)
- ])
- ]),
- _: 3
- }, 8, ["title", "placement", "width", "visible"]);
- };
- }
- }, I = /* @__PURE__ */ $(N, [["__scopeId", "data-v-30da4429"]]);
- export {
- I as default
- };
|