[Vuejs]-Vuejs update all components when state changes

0👍

using computed

as you mentioned the clean way is to use computed property. within the functions you can access this.$store.state and change the behaviour of component n+1 depending on n.

including changes in action

another way would be that your action simply triggers mutations for element n and n+1.

styling related changes

just to mention it, when you want a component to be conditionally displayed or styled, it is often enough to set a class on the modified component n and using conditional styling based on this class to style n+1.

Leave a comment