Strange problem with vuex. Commit succeeded in the component, but the data did not change.

commit in components

api.subscribe({ eventName: this.eventName, email: this.email }).then(res => {
          this.$store.commit("EMAIL", this.email)
        })

the data is received in store, and the output data of the console is normal

//state
const state = {
  userId: "",
  email: ""
}
//mutations
[types.EMAIL](state, email) {
    console.log(email)
    state.email = email
  }

but in vue devtools email is still undefined

if you commit, in the action of store, everything is fine

clipboard.png

Feb.28,2021

mutations = {
    [types.EMAIL](state, email) {
        console.log(email)
        state.email = email
  }
}

after working for a long time, I don't know what the problem is. Replace parcel with webpack, problem solving
parcel can only build dispatch, not commit

Menu