In my nuxt project I'm trying to use mapGetters with the rename object syntax as described in the docs. Getters are namespaced in a module called currentTournament.
This is the computed property inside a mixin:
computed: {
...mapGetters('currentTournament', [{ tAllowedBaskets: 'allowedBaskets' }]),
}
If I log component's this, instead of the tAllowedBaskets property a new property appears [object Object]: undefined. However, if I use the 'simple' string syntax:
...mapGetters('currentTournament', ['allowedBaskets'])
allowedBaskets property appears correctly.
Why can the object syntax be not working?
The proper syntax is
...mapGetters('currentTournament', { tAllowedBaskets: 'allowedBaskets' }),
you don't need to have square brackets [] as shown in this part of the vuex documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With