@aplus-frontend/ui
Version:
49 lines (48 loc) • 1.57 kB
JavaScript
import { defineComponent as f, ref as m, createBlock as l, openBlock as o, unref as s, withCtx as c, createElementBlock as _, Fragment as i, renderList as v, mergeProps as h, createElementVNode as y, withDirectives as k, createVNode as w, vShow as g, resolveDynamicComponent as C, h as b } from "vue";
import { LoadingOutlined as L } from "@ant-design/icons-vue";
import { Menu as M, MenuItem as B } from "@aplus-frontend/antdv";
const R = { style: { display: "flex", "align-items": "center" } }, I = /* @__PURE__ */ f({
__name: "MenuItemGroup",
props: {
selectedRows: {},
buttonProps: {},
menuList: {}
},
setup(d) {
const a = d, t = m({});
async function p(r, u) {
const e = r?.id || u;
t.value[e] = !0;
try {
await r?.onClick?.({ selectedRows: a?.selectedRows });
} finally {
t.value[e] = void 0;
}
}
return (r, u) => (o(), l(s(M), null, {
default: c(() => [
(o(!0), _(i, null, v(a.menuList, (e, n) => (o(), l(s(B), h({
key: e?.id || n
}, { ref_for: !0 }, {
...e,
onClick: () => p(e, n),
disabled: t.value[e?.id || n] ?? e?.disabled ?? !1
}), {
default: c(() => [
y("div", R, [
k(w(s(L), { style: { "margin-right": "10px" } }, null, 512), [
[g, t.value[e?.id || n]]
]),
(o(), l(C(b(i, [e?.content]))))
])
]),
_: 2
}, 1040))), 128))
]),
_: 1
}));
}
});
export {
I as default
};