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