@aplus-frontend/ui
Version:
32 lines (31 loc) • 1.21 kB
JavaScript
import { defineComponent as m, createVNode as o, mergeProps as t, createTextVNode as s } from "vue";
import { omit as n } from "lodash-unified";
import "../../../config-provider/index.mjs";
import "../../ap-tag/index.mjs";
import i from "../ApLabel.mjs";
import { ApLabelGroupProps as p } from "../constans.mjs";
import { useNamespace as c } from "../../../config-provider/hooks/use-namespace.mjs";
import f from "../../ap-tag/ap-tag.vue.mjs";
const _ = /* @__PURE__ */ m({
name: "ApLabelGroup",
props: p(),
setup(r) {
const {
b: a
} = c("ap-label-group"), l = (e) => (r.tagValue || r.tagValue === 0) && e.tagConfig && e.tagConfig.length > 0 ? () => e.tagConfig.filter((u) => r.tagValue === u.value).map((u) => o(f, t(n(u, ["type", "size"]), {
size: "small",
type: "border"
}), null)) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
return () => o("div", {
class: a()
}, [r.columns ? r.columns.map((e, u) => o(i, t({
key: u,
show: r.value === e.value
}, n(e, ["value", "tagConfig", "customRender"])), {
custom: l(e)
})) : o("div", null, [s("columns数组不能为空")])]);
}
});
export {
_ as default
};