Closed luluxia closed 2 years ago
Will be fix in next patch, ty for issue
Alright, how you add new items, need to calculate itemsPosition
ex:
const lastGridItem = this.layout[this.layout.length - 1]
const newIndex = lastGridItem.i + 1
const { y, x } = lastGridItem
const isFullLine = this.layout.filter(l => l.y === y).length === 4 // row lelngth
const newY = isFullLine ? y + 3 : y
const newX = isFullLine ? 0 : x + 3
const newGridItem = { x: newX, y: newY, w: 3, h: 3, index: newIndex }
this.layout.push(newGridItem)
just like the gif, i added items, and the height of layout always 85px. i tried add these code in
GridLayout.vue
and it works, maybe can fix it.