vuex-class-component icon indicating copy to clipboard operation
vuex-class-component copied to clipboard

Accessing Nuxt Router inside Vuex module

Open domi91c opened this issue 6 years ago • 1 comments

I've been trying out this package in a Nuxt app, and I'm just trying to find a way to change paths with Vue Router inside a Vuex action. Normally that would be with this.$router.push('...'), but I can't access this.$router inside the Vuex module. Can anyone let me know if this is possible?

domi91c avatar Aug 15 '19 19:08 domi91c

You can access the store through this.$store, so you have the context that includes the redirect method

Mbale avatar Aug 16 '19 11:08 Mbale