Just to reiterate, because the asyncData
method is server-rendered, accessing your component's data
directly is not possible.
The previous workaround may be effective, but it seems to go against the intended usage of Nuxt and involves complexities like using a third-party library like Vuex and manipulating the context object.
As per the information provided in the API documentation, the data fetched by the asyncData
method will be integrated into your component's data
after the client-side load, granting you access to the returned value object of your page.
This implies that you can utilize this data directly to update the state of your page once the server-side rendering is complete. You have the option to leverage Vue's reactivity for direct usage or incorporate the value within the mounted
property of your page, offering a tailored solution for your specific use case.