adverich-kun-ui
Version:
Una librería de componentes Vue.js con Tailwind CSS
23 lines (22 loc) • 712 B
JavaScript
function v() {
function r(c, i, u = []) {
const n = (e) => {
var s;
const o = c.value;
if (!o) return;
const d = ((s = e.composedPath) == null ? void 0 : s.call(e)[0]) || e.target;
[o, ...u.map((t) => t == null ? void 0 : t.value)].some(
(t) => t == null ? void 0 : t.contains(d)
) || i(e);
};
return { addEventListeners: () => {
document.addEventListener("click", n, !0), document.addEventListener("touchstart", n, !0);
}, removeEventListeners: () => {
document.removeEventListener("click", n, !0), document.removeEventListener("touchstart", n, !0);
} };
}
return { onClickOutside: r };
}
export {
v as useKunMenuComposable
};