UNPKG

quick-admin-vue3-core

Version:

以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板

78 lines (77 loc) 2.58 kB
import { defineComponent as P, computed as b, resolveComponent as i, createElementBlock as s, openBlock as r, Fragment as f, renderList as v, unref as u, createBlock as _, mergeProps as S, withCtx as p, createVNode as a } from "vue"; import { t as w } from "./platform-DsTwHxm6.js"; import { u as A, q as d, r as $ } from "./index-C0qRtkRj.js"; import { u as h } from "./next-callback-Bd-U9so0.js"; import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const N = /* @__PURE__ */ P({ __name: "IconBtns", props: { tpl: { default: "add" }, gap: { default: "0" }, stop: { type: Boolean }, iconSize: { default: "1.8em" } }, emits: ["click"], setup(k, { emit: y }) { const { closePopup: C } = A(), B = k, z = y, g = b(() => { const { tpl: o } = B, n = w(o); if (n === "String") return [d[o]]; if (n === "Array") return o.map((t) => d[t]); throw new Error(`暂未处理此类型:${n}`); }); function m(o, n) { const { name: t, text: c } = o; z("click", t, o, h(c, C), n); } return (o, n) => { const t = i("BaseIcon"), c = i("el-button"), x = i("el-popconfirm"); return r(), s("div", { class: "icon-btns f-0", onClick: n[0] || (n[0] = (e) => o.stop && e.stopPropagation()) }, [ (r(!0), s(f, null, v(u(g), (e, I) => (r(), s(f, { key: I }, [ e.popconfirm ? (r(), _(x, S({ key: 0, ref_for: !0 }, u($)(e.popconfirm, { text: e.text, attrs: { type: e.type } }), { onConfirm: (l) => m(e) }), { reference: p(() => [ a(c, { link: "", type: e.type, circle: "" }, { icon: p(() => [ a(t, { name: e.icon, size: o.iconSize }, null, 8, ["name", "size"]) ]), _: 2 }, 1032, ["type"]) ]), _: 2 }, 1040, ["onConfirm"])) : (r(), _(c, { key: 1, link: "", type: e.type, circle: "", onClick: (l) => m(e, l) }, { icon: p(() => [ a(t, { name: e.icon, size: o.iconSize }, null, 8, ["name", "size"]) ]), _: 2 }, 1032, ["type", "onClick"])) ], 64))), 128)) ]); }; } }), V = /* @__PURE__ */ E(N, [["__scopeId", "data-v-ad511e6d"]]); export { V as I };