Skip to content

Document changes in inject definition for feature vuejs/vue#6097 #1069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/v2/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,13 @@ type: api

The `provide` option should be an object or a function that returns an object. This object contains the properties that are available for injection into its descendants. You can use ES2015 Symbols as keys in this object, but only in environments that natively support `Symbol` and `Reflect.ownKeys`.

The `inject` options should be either an Array of strings or an object where the keys stand for the local binding name, and the value being the key (string or Symbol) to search for in available injections.
The `inject` option should be either:
- an array of strings, or
- an object where the keys are the local binding name and the value is either:
- the key (string or Symbol) to search for in available injections, or
- an object where:
- the `name` property is the key (string or Symbol) to search for in available injections, and
- the `default` property is used as fallback value

> Note: the `provide` and `inject` bindings are NOT reactive. This is intentional. However, if you pass down an observed object, properties on that object do remain reactive.

Expand Down