We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e87bc4c commit 93f4f71Copy full SHA for 93f4f71
src/v2/api/index.md
@@ -948,6 +948,34 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
948
}
949
```
950
951
+ > The next 2 examples only work with Vue > 2.2.1. Below that version, injected values were resolved after the `props` and the `data` initialization.
952
+
953
+ Using an injected value as the default for a prop:
954
+ ```js
955
+ const Child = {
956
+ inject: ['foo'],
957
+ props: {
958
+ bar: {
959
+ default () {
960
+ return this.foo
961
+ }
962
963
964
965
+ ```
966
967
+ Using an injected value as data entry:
968
969
970
971
+ data () {
972
+ return {
973
+ bar: this.foo
974
975
976
977
978
979
## Options / Misc
980
981
### name
0 commit comments