UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

23 lines (22 loc) 527 B
import { ref as a, watch as l, onBeforeUnmount as f, nextTick as v } from "vue"; function w(t, o) { const s = a(!1); let e = null; function n() { e && (e.disconnect(), e = null); } async function i() { n(), await v(); const r = t.value; r && (e = new ResizeObserver((u) => { const c = u[0].contentRect.width; s.value = c < o.value; }), e.observe(r)); } return l([t, o], () => { i(); }, { immediate: !0 }), f(n), { isResponsive: s, start: i, stop: n }; } export { w as u };