Vuex uses mapActions to report Cannot read property 'dispatch' of undefined

mapActions using vuex

//storeaction
const actions = {
  setLoginInfo ({ commit }, data) {
    localStorage.setItem("loginStatus", true)
    commit("SET_LOGIN_STATUS", true)
  },

  setGwShopUserToken ({ commit }, token) {
    localStorage.setItem("GwShopUserToken", token)
    commit("SET_GW_SHOP_USER_TOKEN", "")
  },
}

//
  ...mapActions([
      "setGwShopUserToken"
    ])

I don"t know what caused it

Aug.31,2021
Can the

subject provide multiple codes?


do you use mapActions in methods? See if you set the mapActions where the this points to not the virtual dom.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a518-2c21e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a518-2c21e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?