ideaz-element
Version:
<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>
16 lines (15 loc) • 568 B
JavaScript
import { ref as i, computed as r, onMounted as o, onUnmounted as u } from "vue";
const s = () => {
const e = i(0), t = r(() => e.value >= 1920 ? "xl" : e.value >= 1200 ? "lg" : e.value >= 992 ? "md" : e.value >= 768 ? "sm" : (e.value < 768, "xs")), n = () => {
window && (e.value = window.innerWidth);
};
return o(() => {
n(), window.addEventListener("resize", n);
}), u(() => {
window.removeEventListener("resize", n);
}), { windowReactiveSize: t };
};
export {
s as useWindowReactiveSize
};
//# sourceMappingURL=useWindowReactiveSize.mjs.map