I've declared my data object as queuedItemList: [] which is supposed to contain an array of items provided by a background service. After the HTTP request, I populate the list using a for loop like
for(var i = 0; i < getList.length; i++) {
var newObject = Object.assign({}, getList[i]);
this.queuedItemList.splice(i, 1, newObject);
}
which is used to populate the following template
<Item v-for="(item, index) in queuedItemList" :key="index" :componentData="item" :index="index" @remove="removeItem">
</Item>
I am supposed to do a periodic HTTP GET to get the new list of items, which may also contain current items with maybe different state. Inside the component, I am using a v-if to select between two different icons.
<v-icon name="play" class="controlIcons" v-if ="playControl" />
<v-icon name="pause" class="controlIcons" v-if ="!playControl" />
Now, after some HTTP requests, I see the value of playControl change in Vue Devtools which confirms that the actual value is reflected in the component. However, I can't see the icons change due to the change in the value of playControl. Furthermore, everything works as expected if I refresh the screen.
My guess is that I'm messing up the reactivity somewhere. Thanks!