If I define asyncData in page component, in the asyncData function, I can access the variable defined before component definition in the .vue file. But in the mixin definition, it's not possible to access the variable defined in page component.
Is there a way to pass parameter to asyncData in mixin?
Hi. fetch and asyncData are being called at an early stage before VM instance being created. So all we can do is access passed context. You can use nuxt plugins (with exported function) for adding mixins into that context :) (example)
Thanks a lot!
Hi.
fetchandasyncDataare being called at an early stage before VM instance being created. So all we can do is access passed context. You can use nuxt plugins (with exported function) for adding mixins into that context :) (example)
Unfortunately the example has moved. Could you give a new link if you have one?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
@Erreke see https://nuxtjs.org/guide/plugins#combined-inject 鈽猴笍
Most helpful comment
Unfortunately the example has moved. Could you give a new link if you have one?