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
* close #6097: Allow defining optional inject dependency with default values
Document changes in inject definition for feature #6097
* reformatted description of inject options
* further clarification of inject options description
Copy file name to clipboardExpand all lines: src/v2/api/index.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1008,7 +1008,13 @@ type: api
1008
1008
1009
1009
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`.
1010
1010
1011
-
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.
1011
+
The `inject` option should be either:
1012
+
- an array of strings, or
1013
+
- an object where the keys are the local binding name and the value is either:
1014
+
- the key (string or Symbol) to search for in available injections, or
1015
+
- an object where:
1016
+
- the `name` property is the key (string or Symbol) to search for in available injections, and
1017
+
- the `default` property is used as fallback value
1012
1018
1013
1019
> 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.
0 commit comments