UNPKG

tdesign-vue-next

Version:
42 lines (37 loc) 964 B
/** * tdesign v1.11.5 * (c) 2025 tdesign * @license MIT */ import { ref } from 'vue'; import { useListener } from '../../hooks/useListener.js'; import { isServer } from '../../utils/dom.js'; import '../../_chunks/dep-caecb55d.js'; import 'lodash-es'; var calcSize = function calcSize(width) { var size = "xs"; if (width < 768) { size = "xs"; } else if (width >= 768 && width < 992) { size = "sm"; } else if (width >= 992 && width < 1200) { size = "md"; } else if (width >= 1200 && width < 1400) { size = "lg"; } else if (width >= 1400 && width < 1880) { size = "xl"; } else { size = "xxl"; } return size; }; function useRowSize() { var size = ref(calcSize(isServer ? 0 : window.innerWidth)); var updateSize = function updateSize() { size.value = calcSize(isServer ? 0 : window.innerWidth); }; useListener("resize", updateSize); return size; } export { useRowSize }; //# sourceMappingURL=index.js.map