[Vuejs]-Why do my components not updating reactively in this vuejs application?

0👍

With Vuex, it’s best to treat the state properties (in mutations) as immutable.

Your assignTeamToRoute mutation is potentially adding object properties which is not reactive (see https://v2.vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats)

Try the following using Vue.set

assignTeamToRoute (state, payload) {
  const current = state.route_team_map[payload.routeName] || [];
  Vue.set(state.route_team_map, payload.routeName, current.concat(payload.team.name))
}

You’ll probably need to do something similar with the mutations that remove teams from routes.

👤Phil

Leave a comment