我目前正在致力于 angular-gridster2 的集成。目标是获得一个具有固定行高、固定列数的网格,并且应该计算大小。这是我当前的 GridsterConfig:
{
setGridSize: true,
margin: 5,
displayGrid: DisplayGrid.OnDragAndResize,
gridType: GridType.VerticalFixed,
keepFixedHeightInMobile: true,
fixedRowHeight: 50,
minCols: 6,
maxCols: 6,
swap: true,
pushItems: true,
resizable: { enabled: true },
draggable: {enabled: true },
enableEmptyCellDrop: true,
}
Run Code Online (Sandbox Code Playgroud)
使用此配置,网格高度将按预期计算(完美)。问题是窗口大小调整后宽度保持不变。当我将 setGridSize 属性设置为 false 时,宽度计算按预期工作,但高度始终是边距的 2 倍。