I need to calculate the sum of widths of a number of images which are loaded from a Vuex array of objects:
var activities = [
{
id: 1,
imageUrl: '/static/images/activity1.jpg',
},
{
id: 2,
imageUrl: '/static/images/activity2.jpg',
}
]
However, the sizes are always zero, even if I test it directly in the mounted() method:
mounted: function() {
console.log(document.getElementById('scroller-list').children[0].firstChild.offsetWidth)
},
Is there any way to force Vue to fetch those sizes after everything has rendered?