File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -954,6 +954,34 @@ if (version === 2) {
954
954
}
955
955
```
956
956
957
+ > Следующие два примера работают только в Vue > 2.2.1. Ниже этой версии, внедрённые значения устанавливаются после инициализации ` props ` и ` data ` .
958
+
959
+ Использование внедрённого значения, значением по умолчанию для входных данных:
960
+ ``` js
961
+ const Child = {
962
+ inject: [' foo' ],
963
+ props: {
964
+ bar: {
965
+ default () {
966
+ return this .foo
967
+ }
968
+ }
969
+ }
970
+ }
971
+ ```
972
+
973
+ Использование внедрённого значения в качестве данных:
974
+ ``` js
975
+ const Child = {
976
+ inject: [' foo' ],
977
+ data () {
978
+ return {
979
+ bar: this .foo
980
+ }
981
+ }
982
+ }
983
+ ```
984
+
957
985
## Опции — разное
958
986
959
987
### name
Original file line number Diff line number Diff line change @@ -229,7 +229,8 @@ new Vue({ el: '#range' })
229
229
<my-component
230
230
v-for =" (item, index) in items"
231
231
v-bind:item =" item"
232
- v-bind:index =" index" >
232
+ v-bind:index =" index"
233
+ v-bind:key =" item.id" >
233
234
</my-component >
234
235
```
235
236
You can’t perform that action at this time.
0 commit comments