UNPKG

use-flex-wrap

Version:

<div align='center'> <a> <img width='200' src="logo.jpeg" alt='logo'> </a> </div>

30 lines (29 loc) 735 B
import { ref as o, onMounted as u, onUnmounted as d } from "vue"; import { o as l, c as p, d as v, a as f } from "./options-DkQzU_Ju.js"; const b = (c) => { const { debounceTime: i } = { ...l, ...c }, e = o(null), a = o(!1), r = o(0), s = () => { if (!e.value) return; const { isWrap: t, wrapStage: n } = v(e.value); a.value = t, r.value = n; }; return u(() => { const t = f(s, i); if (e.value) { const { disconnect: n } = p( e.value, t ); window.addEventListener("resize", t), d(() => { n(), window.removeEventListener("resize", t); }); } }), { containerRef: e, wrap: a, wrapStage: r, detectWrap: s }; }; export { b as useFlexWrap };