vuex getters actions
-
please give a sample code for whole vuex store on quasar .
this.$store.getters.nameOfStore.nameOfGetters does not work.
and in quasar.dev there is only this :
https://quasar.dev/quasar-cli/cli-documentation/vuex-store#Adding-a-Vuex-Module. -
try this.$store.getters[‘MODULE_NAMESPACE/GETTER_NAME’].
example: this.$store.getters[‘auth/getUsername’] -
This is better:
In your component:
computed: {
…mapGetters(‘MODULE_NAMESPACE’, [‘GETTER_NAME’])
}then you can use the store getter as a computed property in your component.
-
it little confusing on docs , a example would really help
-
@king_of_leon you should read vuex docs too.
-
ok thanks