use rowGap property with gridRowGap as fallback

This commit is contained in:
Alina Beck 2019-08-20 15:46:41 +01:00
parent f5ef859cc9
commit 626e9e24d4

View File

@ -15,9 +15,10 @@ export default {
calculateItemHeight() {
this.$parent.$emit('calculating-item-height')
this.$nextTick(() => {
const grid = this.$parent
const rowHeight = parseInt(grid.$el.style.gridAutoRows)
const rowGap = parseInt(grid.$el.style.gridRowGap)
const gridStyle = this.$parent.$el.style
const rowHeight = parseInt(gridStyle.gridAutoRows)
const rowGapValue = gridStyle.rowGap || gridStyle.gridRowGap
const rowGap = parseInt(rowGapValue)
const itemHeight = this.$el.clientHeight
this.rowSpan = Math.ceil((itemHeight + rowGap) / (rowHeight + rowGap))