UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

73 lines (72 loc) 2.52 kB
import { defineComponent as C, createElementBlock as a, openBlock as l, createCommentVNode as r, createVNode as u, unref as e, Transition as _, withCtx as h, normalizeClass as y, createElementVNode as n, toDisplayString as v, renderSlot as V } from "vue"; import { useDrawer as B } from "./hook/useDrawer.mjs"; import { Icon as b } from "@vuux/icons"; const x = { class: "app-drawer" }, D = { key: 0, class: "drawer-head" }, N = { class: "drawer-title" }, g = { class: "drawer-content" }, z = { key: 1, class: "drawer-footer" }, E = { class: "drawer-buts" }, O = /* @__PURE__ */ C({ name: "Drawer", __name: "index", props: { position: { default: "right" }, modelValue: { type: Boolean, default: !1 }, title: { default: "默认标题" }, header: { type: Boolean, default: !1 }, footer: { type: Boolean, default: !1 }, maskClose: { type: Boolean, default: !0 } }, emits: ["update:modelValue", "ok", "close"], setup(i, { emit: f }) { const o = i, p = f, { animation: k, handleClose: d, handleOk: c, handleMaskClose: m } = B(o, p); return (w, t) => (l(), a("div", x, [ o.modelValue ? (l(), a("div", { key: 0, class: "drawer-mask", onClick: t[0] || (t[0] = //@ts-ignore (...s) => e(m) && e(m)(...s)) })) : r("", !0), u(_, { name: e(k) }, { default: h(() => [ o.modelValue ? (l(), a("div", { key: 0, class: y(["drawer-slot", o.position]) }, [ o.header ? (l(), a("div", D, [ n("div", N, v(o.title), 1), u(e(b), { name: "Icon9176904", size: 14, class: "drawer-close-icon", onClick: e(d) }, null, 8, ["onClick"]) ])) : r("", !0), n("div", g, [ V(w.$slots, "default") ]), i.footer ? (l(), a("div", z, [ n("div", E, [ n("button", { class: "is-close", onClick: t[1] || (t[1] = //@ts-ignore (...s) => e(d) && e(d)(...s)) }, "关闭"), n("button", { class: "is-ok", onClick: t[2] || (t[2] = //@ts-ignore (...s) => e(c) && e(c)(...s)) }, "确认") ]) ])) : r("", !0) ], 2)) : r("", !0) ]), _: 3 }, 8, ["name"]) ])); } }); export { O as default };