vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
51 lines (50 loc) • 1.57 kB
JavaScript
import { defineComponent as h, useTemplateRef as k, createElementBlock as t, openBlock as o, renderSlot as i, createVNode as C, Transition as B, withCtx as g, createCommentVNode as v, unref as l, withModifiers as w, normalizeStyle as x, normalizeClass as E, toDisplayString as S } from "vue";
import { useTooltip as T } from "./hook/useTooltip.mjs";
const N = {
key: 0,
class: "tooltip-content"
}, V = /* @__PURE__ */ h({
name: "Tooltip",
__name: "index",
props: {
content: {},
placement: { default: "top" },
delay: { default: 200 },
always: { type: Boolean },
className: {},
trigger: { default: "hover" },
disabled: { type: Boolean },
shadow: { type: Boolean },
theme: { default: "light" }
},
emits: ["change"],
setup(e, { expose: p, emit: r }) {
const c = e, d = r, n = k("tooltipEl"), { state: m, tooltipStyle: f, tooltipBoxClass: u, handleClose: y } = T(c, n, d);
return p({
close: y
}), (s, a) => (o(), t("div", {
ref_key: "tooltipEl",
ref: n,
class: "app-tooltip"
}, [
i(s.$slots, "default"),
C(B, { name: "ease" }, {
default: g(() => [
l(m).visible ? (o(), t("div", {
key: 0,
class: E(l(u)),
style: x(l(f)),
onClick: a[0] || (a[0] = w(() => {
}, ["stop"]))
}, [
e.content ? (o(), t("span", N, S(e.content), 1)) : i(s.$slots, "content", { key: 1 })
], 6)) : v("", !0)
]),
_: 3
})
], 512));
}
});
export {
V as default
};