You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few lines later from: guide also needs changing to from: 'guide'.
There is an important distinction between the provide method, which is part of the Application API, and the provide option for components. While they're both part of the provide/inject mechanism they are distinct ways to provide data.
I've put together an example to demonstrate the difference between the two:
I'm not suggesting using that example in the documentation as I suspect it would be confusing. I just wanted to illustrate the difference between the two here. Notice how data provided via the application is injected into the root component, whereas data provided by the root component is only available in its descendants, not in the root component itself.
I reported these problems previously (#345) but I think there may have been a misunderstanding about what changes needed to be made. In summary:
The provide method needs to be documented in the Application API section of the API Reference.
The example in the migration guide needs to be updated.
The text was updated successfully, but these errors were encountered:
@skirtles-code thank you for the issue and for the amazingly detailed description! Would you prefer to create a PR for this or to leave this for me? Either way is fine 👍🏻
The method
app.provide
is not documented in the API Reference.There is a mention of it here but the example is incorrect:
https://github.com/vuejs/docs-next/blame/639940b6154e318b0b26fd4a394defaa82eb45ba/src/guide/migration/global-api.md#L168
The current example given is:
I believe that should be:
A few lines later
from: guide
also needs changing tofrom: 'guide'
.There is an important distinction between the
provide
method, which is part of the Application API, and theprovide
option for components. While they're both part of theprovide
/inject
mechanism they are distinct ways to provide data.I've put together an example to demonstrate the difference between the two:
https://jsfiddle.net/skirtle/59h2ya1g/3/
I'm not suggesting using that example in the documentation as I suspect it would be confusing. I just wanted to illustrate the difference between the two here. Notice how data provided via the application is injected into the root component, whereas data provided by the root component is only available in its descendants, not in the root component itself.
I reported these problems previously (#345) but I think there may have been a misunderstanding about what changes needed to be made. In summary:
provide
method needs to be documented in the Application API section of the API Reference.The text was updated successfully, but these errors were encountered: