How to access Vuex module getters and mutations?

后端 未结 6 1246
长发绾君心
长发绾君心 2021-01-30 13:04

I\'m trying to switch to using Vuex instead of my homegrown store object, and I must say I\'m not finding the docs as clear as elsewhere in the Vue.js world. Let\'s say I have a

6条回答
  •  醉酒成梦
    2021-01-30 13:08

    Try this approach!

    getCounter(){
      return this.$store.getters['auth/getToken'];     
    }
    

    auth is my module name and getToken is my getter.

提交回复
热议问题