D
D
devilsD2018-07-25 10:49:12
JavaScript
devilsD, 2018-07-25 10:49:12

How to access this.$store from a component in nuxt?

How to refer to this.$store in some ../compotents/some.vue component - I get an error:
Unhandled promise rejection TypeError: "this.$store is undefined"
In my case, I call the action this.$store.dispatch( 'login', form); in the login-form.vue component;
Maybe I'm using the wrong approach?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2018-07-25
@Fragster

https://nuxtjs.org/guide/vuex-store

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question