Hey there, Next documentation says you can gain access to your plugins via the ‘app’ key from the context object that is passed in async data.
The root Vue instance that includes all your plugins. For example, when using axios, you can get access to $axios through context.app.$axios.
I’ve created a custom plugin with global vue methods, as well as some $prototypes, and I don’t have access to them via app.
I also tried using axios like they suggested, but that doesn’t work either.
Goals I’m trying to accomplish: I have a function I invoke when pulling from a prismic.io api as async data. There is no access to ‘this’ since async data is rendered on the server.
I really would like to have easy access to that function on all my page components. Keep my code as dry as possible.
Any thoughts?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1757">#c1757</a>)</em></sub></div>