UNPKG

@wetspace/pro-components

Version:
75 lines (74 loc) 2.29 kB
import { defineComponent as E, openBlock as i, createBlock as a, unref as t, mergeProps as r, withCtx as o, createVNode as n, createTextVNode as m, renderSlot as f } from "vue"; import { ElPopconfirm as x, ElButton as c, ElSpace as d, ElIcon as u, ElMessageBox as P } from "element-plus"; import { Delete as y } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.4.2_/node_modules/@element-plus/icons-vue/dist/index.mjs"; import { WetDelButtonProps as C } from "./types.mjs"; const h = /* @__PURE__ */ E({ name: "WetDelButton", __name: "index", props: C, emits: ["confirm"], setup(g, { emit: _ }) { const s = _, e = g, k = async () => { e.emphasizeType === "messagebox" && e.isEmphasize && (await P.confirm("", "", { title: "提示", type: "warning", message: "确认删除?", ...e.messageBoxProps, closeOnClickModal: !1 }), s("confirm")); }, B = () => { s("confirm"); }; return (p, l) => e.isEmphasize && e.emphasizeType === "popconfirm" ? (i(), a(t(x), r({ key: 0 }, e.popconfirmProps, { title: e.popconfirmProps.title || "确认删除?", onConfirm: B }), { reference: o(() => [ n(t(c), r(e, { type: e.type || "danger" }), { default: o(() => [ n(t(d), null, { default: o(() => [ n(t(u), null, { default: o(() => [ n(t(y)) ]), _: 1 }), l[0] || (l[0] = m(" 删除")), f(p.$slots, "default") ]), _: 3 }) ]), _: 3 }, 16, ["type"]) ]), _: 3 }, 16, ["title"])) : (i(), a(t(c), r({ key: 1 }, e, { type: e.type || "danger", onClick: k }), { default: o(() => [ n(t(d), null, { default: o(() => [ n(t(u), null, { default: o(() => [ n(t(y)) ]), _: 1 }), l[1] || (l[1] = m(" 删除")), f(p.$slots, "default") ]), _: 3 }) ]), _: 3 }, 16, ["type"])); } }); export { h as default };