[Vuejs]-V-model populated in a method not updating the DOM

0๐Ÿ‘

โœ…

As you use Vuex, you should get your products directly from you store like in computed property in your vue definition. This will refresh the data directly from store without any action from vue side.

{
...
computed:{
   ...mapGetters({
     queueProducts : 'queueProducts'
   })
}
...
}

Furthermore, if your are using vuex, try to keep your logic inside your store. You vue should only display data.

Hava a look to vuex documentation to know when and where you should use
Getters, Mutations and Actions.

Hope this help.

0๐Ÿ‘

this.queueProducts.forEach(product => {
  ...
  ...
  ...
}
this.$forceUpdate(); // Trying to add this code

I guessed your product.indicatorImg was not been watch by Vue, so it will not update the DOM. Trying to add this.$forceUpdate() in the end. It will force Vue to update DOM.

Leave a comment