@aplus-frontend/ui
Version:
55 lines (54 loc) • 1.93 kB
JavaScript
import { defineComponent as d, computed as g, createElementBlock as a, openBlock as l, normalizeClass as o, unref as t, createElementVNode as r, renderSlot as n, Fragment as h, createBlock as C, createCommentVNode as y, toDisplayString as k, withCtx as v, createVNode as M, normalizeStyle as $ } from "vue";
import { Tooltip as I } from "@aplus-frontend/antdv";
import { QuestionCircleOutlined as N } from "@ant-design/icons-vue";
import "../../config-provider/index.mjs";
import { useNamespace as S } from "../../config-provider/hooks/use-namespace.mjs";
import { useGlobalConfig as B } from "../../config-provider/hooks/use-global-config.mjs";
const D = /* @__PURE__ */ d({
name: "ApTitle",
__name: "ApTitle",
props: {
title: { default: "" },
helpMessage: { default: "" },
helpIconColor: { default: "" },
placement: { default: "top" },
trigger: { default: "hover" }
},
setup(p) {
const i = p, { b: m, e: s, m: u } = S("ap-title"), c = B("uiMode", "aplus"), f = g(() => i.helpIconColor ? {
color: `${i.helpIconColor}`
} : {});
return (e, T) => (l(), a("div", {
class: o([t(m)(), `${t(u)(t(c))}`])
}, [
r("div", {
class: o(t(s)("prefix"))
}, [
e.$slots.prefix ? n(e.$slots, "prefix", { key: 0 }) : (l(), a(h, { key: 1 }, [
r("span", null, k(e.title), 1),
e.helpMessage ? (l(), C(t(I), {
key: 0,
title: e.helpMessage,
placement: e.placement,
trigger: e.trigger
}, {
default: v(() => [
M(t(N), {
style: $(f.value)
}, null, 8, ["style"])
]),
_: 1
}, 8, ["title", "placement", "trigger"])) : y("", !0)
], 64))
], 2),
r("div", {
class: o(t(s)("suffix"))
}, [
n(e.$slots, "suffix")
], 2)
], 2));
}
});
export {
D as default
};