tdesign-vue-next
Version:
TDesign Component for vue-next
54 lines (49 loc) • 1.49 kB
JavaScript
/**
* tdesign v1.13.2
* (c) 2025 tdesign
* @license MIT
*/
import { ref } from 'vue';
import 'lodash-es';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/typeof';
import '../../config-provider/hooks/useConfig.js';
import '@babel/runtime/helpers/slicedToArray';
import '../../_chunks/dep-17e50b35.js';
import { isServer } from '../../utils/dom.js';
import { u as useListener } from '../../_chunks/dep-25e87ffb.js';
import '@babel/runtime/helpers/defineProperty';
import '../../config-provider/utils/context.js';
import '../../_chunks/dep-78c14980.js';
import '../../_chunks/dep-09955460.js';
import 'dayjs';
import '@babel/runtime/helpers/createClass';
import '@babel/runtime/helpers/classCallCheck';
import '../../_chunks/dep-cedcb3d0.js';
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