[Vuejs]-Vuejs – template, store, this.$store is undefined

0πŸ‘

βœ…

As it looks, one has to import the store once again in the UserDropdown.vue component. That doesn’t make any sense to me, since I imported the store in the new Vue instance as shown above.
Here the code fragments to be added in the UserDropdown.vue

...
import {store} from "../store/store";
...
export default {
    store,
    name: 'UserDropdown',
...
...mapGetters({users: 'usersState/AllUsers'})
...

Leave a comment