linkmore-design
Version:
🌈 🚀lm组件库。🚀
18 lines (17 loc) • 722 B
JavaScript
// 列响应数量处理: (盒子总高宽, 列宽度)
export var getResizeColumnCount = function getResizeColumnCount() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
totalWidth = _ref.width;
var colWidth = arguments.length > 1 ? arguments[1] : undefined;
if (totalWidth > 1790) {
return colWidth > 308 ? 4 : colWidth > 228 ? 5 : colWidth > 200 ? 6 : 7;
}
if (totalWidth > 1390) {
return colWidth > 308 ? 3 : colWidth > 228 ? 4 : colWidth > 200 ? 5 : 6;
}
if (totalWidth > 990) {
return colWidth > 308 ? 2 : colWidth > 228 ? 3 : colWidth > 200 ? 4 : 5;
}
// 小于990时
return colWidth > 308 ? 2 : colWidth > 228 ? 3 : colWidth > 200 ? 4 : 5;
};