[Vuejs]-Vue โ€“ Vuex: store not updating when calling action from a child component

0๐Ÿ‘

I think there is conflict between v-model and @change handle. Please try changing v-model to :value and remove get set in computed:

<select class="user-selector" :value="currentUser" @change="handleChange($event)">
  <option v-for="user in users" :key="user" :value="user">User {{ user }}</option>
</select>

  computed: {
    currentUser: {
      return this.$store.getters.currentUser;
    },
  },

Leave a comment