tdesign-vue-next
Version:
TDesign Component for vue-next
57 lines (52 loc) • 1.61 kB
JavaScript
/**
* tdesign v1.13.2
* (c) 2025 tdesign
* @license MIT
*/
import { ref } from 'vue';
import { A as useListener } from '../../_chunks/dep-9c4aef07.mjs';
import { isServer } from '../../utils/dom.mjs';
import 'lodash-es';
import '../../_chunks/dep-b981148e.mjs';
import '../../_chunks/dep-f1895f5a.mjs';
import '../../_chunks/dep-a81129ec.mjs';
import '../../utils/render-tnode.mjs';
import '../../config-provider/hooks/useConfig.mjs';
import '../../config-provider/utils/context.mjs';
import '../../_chunks/dep-466a0666.mjs';
import '../../_chunks/dep-24ce1cec.mjs';
import '../../_chunks/dep-160caab6.mjs';
import '../../_chunks/dep-e497214e.mjs';
import '../../_chunks/dep-98cd1e2d.mjs';
import '../../_chunks/dep-23a929e8.mjs';
import '../../_chunks/dep-48e13ca0.mjs';
import '../../_chunks/dep-033df8e6.mjs';
import '../../_chunks/dep-20550dcc.mjs';
import '../../_chunks/dep-0bb39574.mjs';
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.mjs.map