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