I have a vue component that renders some divs that I'll use as some table's header. What's printed inside those headers is automatically generated as follows:
render (createElement) {
return createElement('div', { class: 'header' },
Array.apply(null, { length: this.initHours.length }).map((i) => {
return createElement('div', { class: 'frame' }, this.getHourIndex())
})
)
}
The function getHourIndex() is:
getHourIndex () {
console.log(this.initHours)
const headerData = this.initHours[this.hourIndex]
this.hourIndex++
return headerData
}
It only runs through an array and return each value.
When I run the app, the divs are displayed on the page, with correct results that are shown for a brief period of time. Then, the app's webpage reloads without me doing anything, and all these divs get moved a few pixels up, and are shown empty. Can someone explain to me the reason behind this behaviour?