[Vuejs]-How to set dynamic styles in Vue.js component from Vuex store

0👍

Thats because you read value from store directly here return this.$store.state.links. This way it is not reactive and also anitpattern, because you should not access store like that.

You should create getter to get value and then it should be ok.

0👍

The problem was that I was not updating the array in my store in a way that Vue observes to trigger a view update, as nada correctly pointed out.

You can see here for more details: vuejs.org/v2/guide/list.html#Array-Change-Detection

Leave a comment