| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- import { ref as i, watch as y, watchEffect as b, openBlock as S, createBlock as C, withCtx as a, createElementVNode as c, renderSlot as m, createVNode as n, 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: {
- // 显隐(v-model:value)
- value: {
- type: Boolean,
- default: !1
- },
- // 抽屉标题
- title: {
- type: String,
- default: ""
- },
- // 弹出方向:right / left / top / bottom
- mode: {
- type: String,
- default: "right"
- },
- // 左右方向时的宽度,单位 px
- width: {
- type: Number,
- default: 500
- },
- // 上下方向时的高度,单位 px
- height: {
- type: Number,
- default: 378
- }
- },
- emits: ["update:value", "confirm"],
- setup(t, { emit: p }) {
- const l = p, o = t, s = i(o.value);
- y(
- () => o.value,
- (e) => {
- s.value = e;
- },
- { immediate: !0 }
- );
- const h = i(o.mode), _ = i(8);
- b(() => {
- const e = {
- left: "",
- right: "",
- top: "",
- bottom: ""
- };
- Object.keys(e).includes(o.mode) || (console.warn(`当前设置mode【${o.mode}】不在【${e}】中,已默认为【right】`), h.value = "right");
- });
- const r = () => {
- l("update:value", !1);
- }, v = () => {
- l("update:value", !1), l("confirm");
- };
- return (e, V) => {
- const d = $, w = B, g = k;
- return S(), C(g, {
- rootClassName: "s-drawer-wrap",
- title: t.title,
- placement: t.mode,
- width: t.width,
- height: t.height,
- visible: s.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, [
- n(w, { size: _.value }, {
- default: a(() => [
- m(e.$slots, "footer", {}, () => [
- n(d, { onClick: r }, {
- default: a(() => [
- u(f(e.$l("取消")), 1)
- ]),
- _: 1
- }),
- n(d, {
- type: "primary",
- onClick: v
- }, {
- default: a(() => [
- u(f(e.$l("确定")), 1)
- ]),
- _: 1
- })
- ], !0)
- ]),
- _: 3
- }, 8, ["size"])
- ])
- ]),
- _: 3
- }, 8, ["title", "placement", "width", "height", "visible"]);
- };
- }
- }, T = /* @__PURE__ */ N(z, [["__scopeId", "data-v-db140b8a"]]);
- export {
- T as default
- };
|